Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 273514 - Virtual interfaces not shown by ifconfig after reboot
Summary: Virtual interfaces not shown by ifconfig after reboot
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-10 10:40 UTC by Patryk Rzadzinski
Modified: 2009-07-02 05:56 UTC (History)
1 user (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 Patryk Rzadzinski 2009-06-10 10:40:59 UTC
Hello,

I've recently come across this problem, I'm quite sure it was fine a while ago. I'm running amd64 on a machine with 2 NICs, using it as a gateway. For security purposes I have defined 2 public IPs on the WAN ethernet interface, one on the eth1 and one on eth1:0 virtual interface. I've set the traffic to go via eth1:0 by default, as both public IPs are on separate networks.

I have what I wanted, for example the main ip a.b.c.d is used for incoming connections, while the other (with the default gateway) f.g.h.i address is used for outbound connections. Furthermore, whatismyip.com shows the right address.

The problem is, after a reboot, ipconfig or ipconfig -a does not show any virtual interfaces (like eth0:1, eth1:0, etc) at all. They work, but they are not listed.

Please see my /etc/conf.d/net below:
config_eth0=( "192.168.0.1/24" )
config_eth1=( 	"a.b.c.d netmask 255.255.255.252"
		"f.g.h.i netmask 255.255.255.248" )
routes_eth1=( "default via f.g.h.j" )


Reproducible: Always
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-13 22:04:44 UTC
Please post your "emerge --info".
Comment 2 Mike Auty (RETIRED) gentoo-dev 2009-06-14 10:11:41 UTC
The information in "emerge --info" will tell us which version of baselayout and/or openrc you're using, as well as other valuable information, so do still post it please.  However, also note that in openrc the net.example file has the following information:

# If you need more than one address, you can use something like this
# NOTE: ifconfig creates an aliased device for each extra IPv4 address
#       (eth0:1, eth0:2, etc)
#       iproute2 does not do this as there is no need to
#config_eth0=(
#       "192.168.0.2/24"
#       "192.168.0.3/24"
#       "192.168.0.4/24"
#)

That suggests that you're using iproute2 to configure your devices, and it's managing to assign the two addresses successfully to the single ethernet adaptor.

Please also include the output from "ifconfig -a" and "ip addr" after a reboot.

You may be able to affect this with a line such as:

modules="ifconfig"

or similar to force ifconfig to carry out the configuration, rather than iproute2.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-17 17:48:55 UTC
Reopen this bug when you provide the requested information.
Comment 4 Patryk Rzadzinski 2009-06-17 17:58:33 UTC
I'm sorry for the delay, literally swamped. I also can't reboot the server too often. I'll try over the weekend, if I get the chance.

I think you are right that the problem is because it's done via iproute2 rather than ifconfig. I've always managed to do everything I needed with ifconfig and route. ip addr show lists the address configured.

If you agree that's the case, please close the bug. Maybe an extra comment to the net.example would be in place, something to warn other users and save you guys some work ;-)


Here's my emerge --info anyway:

Portage 2.1.6.7 (default/linux/amd64/2008.0, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.29-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-r1-x86_64-Intel-R-_Xeon-R-_CPU_E5410_@_2.33GHz-with-glibc2.2.5
Timestamp of tree: Tue, 14 Apr 2009 08:00:06 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -mtune=nocona"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /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="-O2 -pipe -march=nocona -mtune=nocona"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j5"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X509 acl acpi amd64 apache2 berkdb bzip2 caps cli cracklib crypt curl curlwrappers dri expat ftp gdbm gmp gnutls iconv ident imap isdnlog ithreads libffi logrotate masquerade md5sum midi mime mmx mmx-ext mudflap multilib mysql ncurses nls nptl nptlonly ntp offensive openmp openntpd pam pcre perl php posix pppd python readline reflection ruby session smp sockets spf spl sqlite sse sse2 ssl ssse3 sysfs syslog tcpd threads unicode urandom usb xinetd 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 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="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERL
Comment 5 Wormo (RETIRED) gentoo-dev 2009-07-02 05:56:18 UTC
Yes, the confusion comes from secondary ip addresses created by iproute2 not being visible to ifconfig which only looks for old-style ethernet aliases "ethX:Y".

That comment that explains iproute2 doesn't create old-style ethernet aliases:
  
# NOTE: ifconfig creates an aliased device for each extra IPv4 address
#       (eth0:1, eth0:2, etc)
#       iproute2 does not do this as there is no need to

could probably be clearer, but it will probably stand until someone sends a patch for improvement :]