I have a wireless card called eth1 and a wired nic called eth0. When either eth1 or eth1 and eth0 are managed by ifplugd the names are swapped and settings for wireless setup are applied to eth0 and vice versa. This only happens on startup. An rmmod/modprobe of the wireless card causes the link establishment on just the wireless card. net: # /etc/conf.d/net: # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $ RC_VERBOSE=yes config_eth0=( "dhcp" ) dhcpcd_eth0="-DN -h Hannah" gateway="eth1/192.168.1.1" modules_eth1=( "iwconfig" ) config_eth1=( "dhcp" ) dhcpcd_eth1="-DN -h Hannah" wireless: # /etc/conf.d/wireless: essid_eth1="shilohap" mode_eth1="managed" channel_eth1="11" sleep_scan_eth1="5" sleep_associate_eth1="5" key_shilohap="s:xxx enc xxx" preferred_aps_eth1=( "shilohap" ) ifplugd -*-sh-*- # $Id: gentoo-ifplugd-conf-v3,v 1.2 2005/03/22 13:05:53 ka0ttic Exp $ INTERFACES="eth0 eth1" AUTO="no" BEEP="yes" IGNORE_FAIL="yes" IGNORE_FAIL_POSITIVE="no" IGNORE_RETVAL="yes" POLL_TIME="1" DELAY_UP="0" DELAY_DOWN="0" API_MODE="auto" SHUTDOWN="no" WAIT_ON_FORK="no" MONITOR="no" ARGS="-f -u 5" MONITOR_eth1="yes" DELAY_UP_eth1="5" DELAY_DOWN_eth1="5" system log: ul 5 10:05:24 [login(pam_unix)] session opened for user root by (uid=0) Jul 5 10:05:54 [ifplugd(eth0)] ifplugd 0.28 initializing. Jul 5 10:05:54 [ifplugd(eth0)] Using interface eth0/00:12:3F:D1:4F:34 with driver <b44> (version: 0.95) Jul 5 10:05:54 [ifplugd(eth0)] Using detection mode: SIOCETHTOOL Jul 5 10:05:54 [ifplugd(eth0)] Initialization complete, link beat detected. Jul 5 10:05:54 [ifplugd(eth1)] ifplugd 0.28 initializing, using NETLINK device monitoring. Jul 5 10:05:54 [ifplugd(eth1)] Using interface eth1/00:12:F0:8E:9E:31 with driver <ipw2200> (version: 1.0.4) Jul 5 10:05:54 [ifplugd(eth1)] Using detection mode: SIOCETHTOOL Jul 5 10:05:54 [ifplugd(eth1)] Initialization complete, link beat not detected, interface enabled. Jul 5 10:05:54 [ifplugd(eth0)] Executing '/usr/sbin/ifplugd.action eth0 up'. Jul 5 10:05:54 [ifplugd.action] starting interface net.eth0 Jul 5 10:05:54 [ifplugd(eth0)] client: * Starting eth0 Jul 5 10:05:54 [ifplugd(eth0)] client: * Loading networking modules for eth0 Jul 5 10:05:54 [ifplugd(eth0)] client: * modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa Jul 5 10:05:55 [ifplugd(eth0)] client: * iwconfig provides wireless Jul 5 10:05:55 [ifplugd(eth0)] client: * ifconfig provides interface Jul 5 10:05:55 [ifplugd(eth0)] client: * dhcpcd provides dhcp Jul 5 10:05:55 [ifplugd(eth0)] client: * Wireless extensions not found for eth0 Jul 5 10:05:55 [ifplugd(eth0)] client: * Bringing up eth0 Jul 5 10:05:55 [ifplugd(eth0)] client: * dhcp Jul 5 10:06:55 [dhcpcd] timed out waiting for a valid DHCP server response_ Jul 5 10:06:55 [ifplugd(eth0)] client: * Running dhcpcd ... [ !! ] Jul 5 10:06:55 [ifplugd(eth0)] client: [ !! ] Jul 5 10:06:55 [ifplugd(eth0)] Program executed successfully. Jul 5 10:06:56 [ifplugd(eth0)] Link beat lost. Jul 5 10:06:57 [ifplugd(eth0)] Executing '/usr/sbin/ifplugd.action eth0 down'. Jul 5 10:06:57 [ifplugd.action] starting interface net.eth0 Jul 5 10:06:57 [ifplugd(eth0)] client: * ERROR: "net.eth0" has not yet been started. Jul 5 10:06:57 [rc-scripts] ERROR: "net.eth0" has not yet been started. Jul 5 10:06:57 [ifplugd(eth0)] Program executed successfully. Jul 5 10:07:00 [ifplugd(eth1)] Link beat detected. emerge --info Gentoo Base System version 1.6.12 Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.12-ck3 i686) ================================================================= System uname: 2.6.12-ck3 i686 Intel(R) Pentium(R) M processor 1.50GHz Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, Mar 11 2005, 13:17:01)] ccache version 2.3 [enabled] dev-lang/python: 2.3.4-r1 sys-apps/sandbox: [Not Present] sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=i686 -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=i686 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://mirror.isp.net.au/ftp/pub/gentoo/ ftp://mirror.isp.net.au/pub/gentoo/ http://gentoo.osuosl.org ftp://mirror.pacific.net.au/linux/Gentoo http://mirror.gentoo.gr.jp" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://mirror.isp.net.au/gentoo-portage" USE="x86 X acpi alsa apm arts avi bash-completion berkdb bitmap-fonts cdr crypt cups dvd emacs emboss encode foomaticdb fortran ftp gb gdbm gif gmp gnome gphoto2 gpm gtk gtk2 imap imlib java jikes jpeg kde ldap libg++ libwww mad mikmod mmx motif mozilla mp3 mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png ppds python qt quicktime readline samba sdl spell ssl tcpd tiff truetype truetype-fonts type1-fonts usb xml2 xmms xv zlib video_cards_i810 video_cards_i915 userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY package revisions: Searching... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... . [ Results for search key : ipw2200 ] [ Applications found : 2 ] * net-wireless/ipw2200 Latest version available: 1.0.3 Latest version installed: 1.0.3 Size of downloaded files: 131 kB Homepage: http://ipw2200.sourceforge.net Description: Driver for the Intel PRO/Wireless 2200BG/2915ABG miniPCI and 2225BG PCI adapters License: GPL-2 * net-wireless/ipw2200-firmware Latest version available: 2.2 Latest version installed: 2.2 Size of downloaded files: 175 kB Homepage: http://ipw2200.sourceforge.net Description: Firmware for the Intel PRO/Wireless 2200BG/2915ABG miniPCI and 2225BG PCI adapters License: ipw2200-fw Searching... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... . [ Results for search key : baselayout ] [ Applications found : 4 ] * sys-apps/baselayout Latest version available: 1.11.12-r4 Latest version installed: 1.11.12-r4 Size of downloaded files: 152 kB Homepage: http://www.gentoo.org/ Description: Filesystem baselayout and init scripts License: GPL-2 Searching... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... . [ Results for search key : ifplugd ] [ Applications found : 1 ] * sys-apps/ifplugd Latest version available: 0.28 Latest version installed: 0.28 Size of downloaded files: 139 kB Homepage: http://0pointer.de/lennart/projects/ifplugd/ Description: Brings up/down ethernet ports automatically with cable detection License: GPL-2
The interface name is decided by the kernel. As both want "eth", the first one loaded gets "eth0", the second one "eth1". You can alias this in /etc/modules.*d/ all you want, but the behaviour will not change. However, you can write udev rules to fix this or use ifrename (part of wireless-tools - see it's man page) or use the new rename feature in baselayout-1.12.0_pre1-r1.
Thanks Roy for the response. I am not sure that it helps though. I think there is a misunderstanding. In this case the kernel starts the broadcom driver for the wired nic as a builtin module early. So the wired nic gets eth0. It later loads modules according to the modules setup which include the ipw2200 and related modules so it gets eth1. Following this naming by the kernel I then set up the network config to match. This all works if I use the init.d scripts net.eth0 and net.eth1. In fact my workaround is to not use ifplugd and just include the net.eth1 init script in rc-update. However as soon as I use ifplugd it attempts to start the broadcom card as wireless and vice versa. I have not made any attempt to change the references (eth0, eth1) assigned by the kernel. Are you suggesting there is something in the ifplugd config that I have got wrong that is referring to the wrong references? Or are you suggesting that the kernel will randomly change order of loading and so names? If the latter how do you ensure that the configs match the physical cards?
Might I suggest using ifplugd on eth0 only then? You'll be able to use wpa_supplicant-0.4.x and baselayout-1.12.0_pre1 to do the same thing with your ipw card. BTW, I really cannot see anything wrong with your debug log
The original bug is caused by module load order, something with ifplugd does not do