Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 218367 - sys-apps/openrc - Secondary IP addresses can not be applied to VLAN interfaces as per documentation
Summary: sys-apps/openrc - Secondary IP addresses can not be applied to VLAN interface...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-19 06:09 UTC by Reuben Farrelly
Modified: 2010-07-09 01:59 UTC (History)
4 users (show)

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 Reuben Farrelly 2008-04-19 06:09:47 UTC
Adding secondary IP addresses to VLAN interfaces after upgrading to openrc does not seem to work, even after following the instructions in the net.example file (no mention of this in the migration guide).

My config looks like this:

config_vlan10="192.168.10.12/24
192.168.10.13/24"
routes_vlan10="default via 192.168.10.1"

I have also tried with:

config_vlan10="192.168.10.12/24 192.168.10.13/24"

Both yield the same result - that being that the last IP address specified (ie 192.168.10.13) becomes the main and only IP address on vlan10.  No VLAN10:1 or other alias interface is created.

The goal is to have a VLAN10 with 192.168.10.12 and VLAN10:0 (or VLAN10:1) with 192.168.10.13.

After either config change is set in /etc/conf.d/net and ethernet restarted:

tornado conf.d # /etc/init.d/net.eth0 restart
 * Caching service dependencies ... [ ok ]
 * Bringing down interface eth0
 *   Removing addresses
 *     Removing VLAN vlan10 from eth0
 *     Bringing down interface vlan10
 *       Removing addresses
 * Bringing up interface eth0
 *   null ... [ ok ]
 *   Adding VLAN 10 to eth0
 *   Bringing up interface vlan10
 *     192.168.10.12/24 ... [ ok ]
 *     192.168.10.13/24 ... [ ok ]
 *     Adding routes
 *       default via 192.168.10.1 ... [ ok ]
tornado conf.d #

So it *looks* like it works all ok, but it doesn't quite work as expected:

tornado conf.d # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet6 fe80::21b:21ff:fe04:fe1d  prefixlen 64  scopeid 0x20<link>
        ether 00:1b:21:04:fe:1d  txqueuelen 1000  (Ethernet)
        RX packets 660395  bytes 123045014 (117.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 474893  bytes 115158958 (109.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xc8020000-c8040000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 108367  bytes 26989722 (25.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 108367  bytes 26989722 (25.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vlan10: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.10.13  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::21b:21ff:fe04:fe1d  prefixlen 64  scopeid 0x20<link>
        ether 00:1b:21:04:fe:1d  txqueuelen 0  (Ethernet)
        RX packets 141  bytes 15883 (15.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 127  bytes 14457 (14.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tornado conf.d # 

This appears to be a regression from the previous non-openrc scripts where this worked fine.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-19 15:22:51 UTC
emerge --info, please.
Comment 2 Reuben Farrelly 2008-04-19 15:23:59 UTC
tornado ~ # emerge --info
Portage 2.1.5_rc4 (default-linux/amd64/2007.0/no-multilib, gcc-4.2.3, glibc-2.7-r2, 2.6.25-mm1-wip x86_64)
=================================================================
System uname: 2.6.25-mm1-wip x86_64 Intel(R) Pentium(R) D CPU 2.80GHz
Timestamp of tree: Sat, 19 Apr 2008 10:15:03 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r1
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.5, 1.6.3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=native -mtune=native"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.internode.on.net/pub/gentoo http://distfiles.gentoo.org"
LDFLAGS=""
PKGDIR="/usr/portage/packages"
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://rsync.au.gentoo.org/gentoo-portage"
USE="acl acpi amd64 apache2 arj auth bash-completion bcmath berkdb bzip2 cairo cdparanoia cgi clamav clamd cli compress cracklib crypt cups curl dbm dhcp dnotify fortran gd gdbm geoip gif gmp gpm gtk2 gzip hardened hash http httpd iconv imagemagick imap imlib innodb ipv6 jpeg lha libnotify libwww lm_sensors logrotate logwatch lzo mail maildir mcal md5sum memcache mgetty mhash mime mimencode mmap mmx mmxext modperl mpm-worker mudflap mysql mysqli nagios-dns nagios-ntp nagios-ping nagios-ssh ncurses net netpbm nls nosendmail nptl nptlonly ntp openmp openssl pam pam_timestamp patch pcap pcre pear-db perl perlsuid php png posix postfix pppd python rar readline reflection reiserfs rrdcgi rrdtool rtc samba sasl savedconfig screen sendfile sensord serial session sieve snmp spamassassin spell spl sqlite3 sse sse2 ssl startup-notification subject-rewrite suidcheck sysfs syslog sysvipc tcpd tcpwrapper tftp threads tiff timestats transparent-proxy truetype unzip ups utempter vhosts virus-scan wireshark xinetd zip 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 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 mach64  mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis       sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

tornado ~ #
Comment 3 Ian Douglas 2008-04-22 10:05:12 UTC
(In reply to comment #1)
> emerge --info, please.
> 

Have similar problem, with eth0.
The range syntax
config_eth0="10.0.0.{150..180}/24"

did not work (get an error), so resorted to 
config_eth0="
	10.0.0.150/24
	10.0.0.151/24
	10.0.0.152/24
etc... which appears to work as per original poster, but only leaves last mentioned IP address active.

This breaks other things like pure-ftp (guessing here, assume it wants 10.0.0.150 because what it listens to).

Also having problems with apache/php... if I restart apache, it complains about php_admin-flag settings... however if you reboot, apache starts okay. Of course, trying to contact a website at one of the earlier IP addresses doesn't work.

gentoo ~ # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 10.0.0.180  netmask 255.248.0.0  broadcast 10.7.255.255
        inet6 fe80::211:d8ff:fe70:3bc1  prefixlen 64  scopeid 0x20<link>
        ether 00:11:d8:70:3b:c1  txqueuelen 1000  (Ethernet)
        RX packets 897  bytes 635896 (620.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 894  bytes 199233 (194.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 1
        device interrupt 17

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 160  bytes 17570 (17.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 160  bytes 17570 (17.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


gentoo ~ # emerge --info
Portage 2.1.5_rc4 (default-linux/amd64/2006.1/desktop, gcc-4.2.3, glibc-2.7-r2, 2.6.24-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.24-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3200+
Timestamp of tree: Fri, 18 Apr 2008 15:30:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.4.4-r6, 2.5.2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.0/env /usr/kde/4.0/share/config /usr/kde/4.0/shutdown /usr/share/X11/app-defaults /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://mirrors.blueyonder.co.uk/mirrors/gentoo/"
LANG="en_ZA"
LC_ALL="en_ZA"
LDFLAGS=""
LINGUAS="en_ZA en_GB"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac accessibility akode alsa amd64 amr apache2 arts bash-completion berkdb binfilter bitmap-fonts bzip2 cairo cddb cdr cgi cli colordiff cracklib crypt css cups curl dbus djvu dri dts dvd dvdnav dvdr dvdread eds emboss emul-linux-x86 encode esd exif fam firefox flac foomaticdb fortran ftp gd gdbm gif gimp gimpprint gnome gnome-print gpm gstreamer gtk gtk2 hal iconv imagemagick imlib innodb ipv6 isdnlog java javascript jikes joystick jpeg kde kdeenablefinal ldap libungif libwww lm_sensors mad midi mikmod mime mozdevelop mozilla mozsvg mp3 mpeg mudflap mysql mysqli ncurses network nls no-htdocs nodrm nptl nptlonly nsplugin offensive ogg openal opengl openmp oss pam pcre pdf perl php png posix ppds pppd python qt3 qt3support qt4 quicktime rar readline reflection rtc samba scanner sdl session sockets spell spl ssl svg szip tcpd threads tidy tiff truetype truetype-fonts type1-fonts unicode usb v4l vcd visualization vorbis wmf xine xml xml2 xmlreader xmlwriter xorg xpm xv zip zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" 

APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_ZA en_GB" USERLAND="GNU" VIDEO_CARDS="fglrx vga vesa fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Appreciate the efforts :-)

thanks, Ian




Comment 4 Oleg Gawriloff 2009-02-11 09:25:21 UTC
Have same the problem. Solved it by adding following string in /etc/conf.d/eth0:
modules=("ifconfig")

Don't know why its not working with default iproute2 module.
Comment 5 Oleg Gawriloff 2009-02-11 09:26:55 UTC
/etc/conf.d/net of cource.
Comment 6 Dan Johnson 2010-07-09 01:25:10 UTC
Are you certain it was not working with the iproute2 module? iproute2 actually has BETTER handling of multiple ip addresses, but ifconfig lacks the ability to list any of the ones added after the first one. I'd be interested in seeing the output of "ip addr" after the iproute2 module attempts to add more than one ip.

For reference, when I run:
ip addr add 192.168.10.1/24 dev eth0
ip addr add 192.168.10.13/24 dev eth0
ip addr show eth0

I get:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:76:cd:c5:7d brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.1/24 scope global eth0
    inet 192.168.10.13/24 scope global secondary eth0

ifconfig eth0 gives:
eth0      Link encap:Ethernet  HWaddr 00:0c:76:cd:c5:7d  
          inet addr:192.168.10.1  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:95 errors:0 dropped:0 overruns:0 frame:0
          TX packets:353 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8322 (8.1 KiB)  TX bytes:280731 (274.1 KiB)
          Interrupt:21 Base address:0xa000

This is probably just this limitation of ifconfig.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-07-09 01:59:05 UTC
I added this to my config, taken directly from the net.example, slightly further down it.
config_eth2="null"
vlans_eth2="10"
config_eth2_10="192.168.10.12/24 192.168.10.13/24"


# /etc/init.d/net.eth2 restart
net.eth2            | * Caching service dependencies ...  [ ok ]
net.eth2            | * Bringing down interface eth2
net.eth2            | *   Removing VLAN 10 from eth2
net.eth2            | *   Bringing down interface eth2.10
net.eth2            | * Bringing up interface eth2
net.eth2            | *   Running preup ...
net.eth2            | *   null ...  [ ok ]
net.eth2            | *   Adding VLAN 10 to eth2
net.eth2            | *   Bringing up interface eth2.10
net.eth2            | *     Running preup ...
net.eth2            | *     192.168.10.12/24 ...  [ ok ]
net.eth2            | *     192.168.10.13/24 ...  [ ok ]
net.eth2            | *     Waiting for IPv6 addresses ... [ ok ]
net.eth2            | *     Running postup ...
net.eth2            | *   Running postup ...

# ip add show
...
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:22:15:06:39:89 brd ff:ff:ff:ff:ff:ff
...

8: eth2.10@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 00:22:15:06:39:89 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.12/24 brd 192.168.10.255 scope global eth2.10
    inet 192.168.10.13/24 brd 192.168.10.255 scope global secondary eth2.10
    inet6 fe80::222:15ff:fe06:3989/64 scope link 
       valid_lft forever preferred_lft forever


So iproute2 DOES show all addresses.
Relatedly, ifconfig -a shows only the first of the addresses:

eth2.10   Link encap:Ethernet  HWaddr 00:22:15:06:39:89  
          inet addr:192.168.10.12  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::222:15ff:fe06:3989/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:6028 (5.8 KiB)