Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 389437 - sys-apps/openrc: use iproute2 for all networking functions on linux systems
Summary: sys-apps/openrc: use iproute2 for all networking functions on linux systems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks: openrc-tracker
  Show dependency tree
 
Reported: 2011-11-03 19:37 UTC by Steve Neuharth (st33v)
Modified: 2011-12-31 08:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Neuharth (st33v) 2011-11-03 19:37:41 UTC
I have a rather complex network config, using 2 vlans on 2 bonded ethernet interface. I recently updated to the new baseconfig and found my network was broken. 

The fix is to install iproute2. 

Reproducible: Always

Steps to Reproduce:
1. update an old system that has no iproute2 package installed
2. configure your interfaces like I did (bonded with vlans... see attached) 
3. try to start net.bond0
Actual Results:  
I would see "adding slaves to bond0... eth0... null" and there it would stop.

Expected Results:  
it should have continued on to put vlans on bond0 and set the IPs on the VLANs. OR given me an error OR the openrc package should REQUIRE iproute2. Reading through the openrc code, it looks like it simply won't work without it.

here's my config:

config_eth0="null"                      #Disable IP address on Interface
config_eth1="null"                              #Disable IP address on Interface

## Setup Bonding Interface
slaves_bond0="eth0 eth1"
config_bond0="null"                             #Disable IP address on Interface
miimon_bond0="100"
mode_bond0="802.3ad"
xmit_hash_policy="layer3+4"
mtu_bond0="9000"
rc_need_bond0="net.eth0 net.eth1"

## Setup Vlans
vlans_bond0="10 12"
vlan_start_bond0="yes"
#vconfig_vlan10="set_flag 1"            #Enable VLAN flag
#vconfig_vlan12="set_flag 1"            #Enable VLAN flag
#vconfig_bond0="set_flag 1"              #Enable VLAN flag
#vconfig_bond0="set_name_type VLAN_PLUS_VID_NO_PAD"
vlan10_name="vlan10"
vlan12_name="vlan12"

## WAN VLan (vlan10)
config_vlan10="X.X.X.X/23
X.X.X.X/23"
routes_vlan10="X.X.X.X 
default via X.X.X.X"
mtu_vlan10="1500"
rc_need_vlan10="net.bond0"

## LAN VLan (vlan12)
config_vlan12="10.60.1.1/17"
routes_vlan12="10.0.0.0/8 via 10.60.127.254"
mtu_vlan12="9000"
rc_need_vlan12="net.bond0"

## Local Interface
dns_domain_lo="c42"
dns_servers_lo="10.60.127.254 
10.10.42.1 
8.8.8.8"
dns_options_lo="timeout 2 
rotate attempts 3"
Comment 1 Steve Neuharth (st33v) 2011-11-03 19:46:00 UTC
Portage 2.1.10.11 (default/linux/amd64/10.0/server, gcc-4.5.3, glibc-2.12.2-r0, 2.6.39.1 x86_64)
=================================================================
System uname: Linux-2.6.39.1-x86_64-Intel-R-_Core-TM-_i7-2677M_CPU_@_1.80GHz-with-gentoo-2.0.3
Timestamp of tree: Thu, 27 Oct 2011 07:00:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.5-r2, 2.7.1-r1, 3.1.3-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.4.3-r2, 4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo code42
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -march=k8 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-Os -march=k8 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://image.crashplanpro.com/gentoo-portage"
USE="acl acpi alsa amd64 berkdb bzip2 cli cracklib crypt cups cxx dbus dri fortran gdbm gpm hal iconv mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre pppd readline session snmp sse sse2 ssl symlink sysfs tcpd truetype unicode xfce xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vmware vesa vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Christian Ruppert (idl0r) gentoo-dev 2011-11-03 19:47:33 UTC
So the issue is caused through config_bond0="null". The iproute2 interface handles it correctly.
Comment 3 Steve Neuharth (st33v) 2011-11-04 01:55:33 UTC
actually... the null is interesting but that's not the only problem. With my configuration + openrc and no iproute2, the vlans just don't load. I can configure a static on bond0 instead of null and that's the only IP it uses... it never does the vlan stuff. Then I install iproute2, restart bond0 and I get my static on bond0 and the 2 IPs on the vlans like it should be.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-11-04 02:35:55 UTC
Ah, I broke this because the new vlan stuff requires iproute2, whereas the old stuff used the vconfig tool and had bugs and stuff you couldn't do.

A lot of the openrc network configuration stuff requires iproute2 now.
new vlan, macvlan, RPDB, parts of tunnels, ipsec, ip6 neighbour (arp replacement)

WilliamH: any objections to making it required?
Comment 5 William Hubbs gentoo-dev 2011-11-04 14:17:25 UTC
I have no objection to making iproute2 required for linux. Along the
same lines, I would like to suggest dropping ifconfig support for linux.
Is that agreeable?
Comment 6 William Hubbs gentoo-dev 2011-11-04 14:27:25 UTC
I want to look over what we have in git since 0.9.4 and determin if we
need a new release before I start work on this.
Comment 7 Christian Ruppert (idl0r) gentoo-dev 2011-11-04 14:28:59 UTC
(In reply to comment #5)
> I have no objection to making iproute2 required for linux. Along the
> same lines, I would like to suggest dropping ifconfig support for linux.
> Is that agreeable?

+1
Comment 8 SpanKY gentoo-dev 2011-11-10 01:10:39 UTC
basic network support should not require iproute2 (static addresses/routes).  if we want to make it required for anything fancy (vlan/bounding/etc...), that's fine.
Comment 9 Steve Neuharth (st33v) 2011-11-10 01:31:02 UTC
could you make the network stuff gripe about not having iproute2 installed if one is configuring vlans or something? It would just be nice to know why it's failing instead of simply... "null".
Comment 10 William Hubbs gentoo-dev 2011-11-10 06:00:44 UTC
(In reply to comment #8)
> basic network support should not require iproute2 (static addresses/routes). 
> if we want to make it required for anything fancy (vlan/bounding/etc...),
> that's fine.

Can you give more information than "iproute2 should not be required for basic network support"? Iproute2 supports basic network configuration and far more than ifconfig does. I don't think it makes sense to keep using ifconfig for basic network configuration since iproute2 can support basic configuration as well.
Comment 11 William Hubbs gentoo-dev 2011-11-10 07:55:01 UTC
(In reply to comment #9)
> could you make the network stuff gripe about not having iproute2 installed if
> one is configuring vlans or something? It would just be nice to know why it's
> failing instead of simply... "null".

What I would like to do is drop the support for ifconfig, which will then make it possible for us to make iproute2 a hard dependency of openrc on linux systems.

Once we do that, this issue will be solved, because all of our network support on linux will be handled by iproute2 instead of being split between ifconfig and iproute2.
Comment 12 SpanKY gentoo-dev 2011-11-10 16:33:24 UTC
i didn't say iproute2 can't do what we need.  i'm saying that we still want to have an ifconfig module that can support basic network setup.  static ips/routes are trivial to support.
Comment 13 Lars Wendler (Polynomial-C) gentoo-dev 2011-11-10 17:16:35 UTC
I'd like to add that currently with baselayout-2 + openrc having ifconfig _and_ iproute2 installed the oldnet configuration scripts don't respect the modules="ifconfig" varibale. As soon as there's iproute2 installed on a system it's the only choice with oldnet scripts.
This is contradictory to openrc's net.example documentation. 
I wonder if this is intentional or just a bug.
Comment 14 William Hubbs gentoo-dev 2011-11-10 17:32:26 UTC
(In reply to comment #12)
> i didn't say iproute2 can't do what we need.  i'm saying that we still want to
> have an ifconfig module that can support basic network setup.  static
> ips/routes are trivial to support.

They are  also trivial to support with iproute2, so I see no reason to keep the ifconfig module.

(In reply to comment #13)
> I'd like to add that currently with baselayout-2 + openrc having ifconfig _and_
> iproute2 installed the oldnet configuration scripts don't respect the
> modules="ifconfig" varibale. As soon as there's iproute2 installed on a system
> it's the only choice with oldnet scripts.
> This is contradictory to openrc's net.example documentation. 
> I wonder if this is intentional or just a bug.

Did you try

modules="!iproute2"

Openrc prefers iproute2 over ifconfig if iproute2 is installed.
Comment 15 Lars Wendler (Polynomial-C) gentoo-dev 2011-11-10 20:52:00 UTC
(In reply to comment #14)
> 
> Did you try
> 
> modules="!iproute2"
> 
> Openrc prefers iproute2 over ifconfig if iproute2 is installed.

No I didn't. I gonna try that as soon as I have access to a testing machine. But according to the doc it should work with modules="ifconfig", too.
Comment 16 SpanKY gentoo-dev 2011-11-10 22:31:45 UTC
(In reply to comment #14)

because net-tools (which provides ifconfig/route among other tools) is required in the system target.  iproute2 is not.

i suspect ifconfig is also more portable than iproute2 (availability in other operating systems).
Comment 17 William Hubbs gentoo-dev 2011-11-11 01:32:30 UTC
(In reply to comment #16)
> (In reply to comment #14)
> 
> because net-tools (which provides ifconfig/route among other tools) is required
> in the system target.  iproute2 is not.

Why does it matter whether or not something we depend on is required in the system target? We can just make it a dependency for openrc on linux systems.

> i suspect ifconfig is also more portable than iproute2 (availability in other
> operating systems).

If we drop ifconfig support for linux it won't affect ifconfig on the bsds or any other operating system that needs it. We already have a separate ifconfig module for *BSD, and we could write another one if we need it for another operating system.

I just want to remove the ifconfig module for linux and make iproute2 the only interface handler openrc uses on linux.
Comment 18 SpanKY gentoo-dev 2011-11-11 02:05:31 UTC
(In reply to comment #17)

the point is to not add extra dependencies for the basics.  iproute doesn't add anything special for static routes.

i don't have a problem with requiring iproute for anything beyond the basics.  but static mappings are ridiculously simple.
Comment 19 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-12-27 01:26:16 UTC
Instead of forcing iproute2, I've added a check for iproute2 in commit 415f48041 now, for the functionality that actually requires it (vlan, macvlan). This leaves the base ifconfig functionality for those users with simple setups.

Future item: require iproute2 for all IPv6 configs?
Comment 20 SpanKY gentoo-dev 2011-12-31 08:28:59 UTC
for static IPv6 addresses/routes, i don't think that's necessary