# eth0 and eth1 switched on startup [Solved]

## KWhat

It appears that my wireless and regular network card are switched on startup now.  eth0 has always been my wireless and eth1 has  been my regular wired card.  I dont know what happend but now they are backwards.  I checked the bios and i have switching disabled so its probably a software (udev and coldplug) problem.

Anyone have any ideas?Last edited by KWhat on Tue Dec 12, 2006 4:50 am; edited 1 time in total

----------

## noice

you can see here, but it's in italian language..

----------

## KWhat

I know almost no Italian.  From what i understood I made the following changes

/etc/udev/rules.d/10-lirc.rules

```
#Ethernet lan con driver r8169

DRIVERS=="ipw2200", NAME="eth0", SYMLINK="wlan"

DRIVERS=="tg3", NAME="eth1", SYMLINK="elan"

```

This seems to have kind of fixed the issues.  However i think my  network card maybe using the wrong driver.  Where do i specify the driver for each network card?

----------

## richfish

 *KWhat wrote:*   

> I know almost no Italian.  From what i understood I made the following changes
> 
> /etc/udev/rules.d/10-lirc.rules
> 
> ```
> ...

 

You can't specify a driver for a card...udev notices what cards are installed and loads the appropriate drivers based on /lib/modules/`uname -r`/modules.*map.  But if you want to see what driver name is being used for a particular interface name:

udevinfo -a -p /class/net/eth0 | grep DRIVERS

udevinfo -a -p /class/net/eth1 | grep DRIVERS

HTH.

----------

## KWhat

I am not sure whats loading my Ethernet modules because they are not in my modules.auoload file and I dont think i have ifplug installed but my wireless driver gets auto loaded and my elan driver does not.  Any Ideas?

----------

## richfish

 *KWhat wrote:*   

> I am not sure whats loading my Ethernet modules

 

udev now scans the system busses exposed through /sys and loads modules for devices if they are defined in /lib/modules/`uname -r`/modules.alias.

 *KWhat wrote:*   

> because they are not in my modules.auoload file and I dont think i have ifplug installed but my wireless driver gets auto loaded and my elan driver does not.  Any Ideas?

 

I'm not sure I understand.  Does the driver really not get loaded, or is the interface just not configured?  Maybe you can post the outputs of lsmod, ifconfig -a, and lspci.

----------

## GNUtoo

see the GWN(gentoo weekely newsletters) :

http://www.gentoo.org/news/en/gwn/20061204-newsletter.xml

----------

## batudo

For me the DRIVERS rule don't work well because I have two cards with the same driver (via-rhine) and the rule that fix my problem was:

```

KERNEL=="eth*", ATTR{address}=="00:e0:7d:fa:91:d9", NAME="eth0"

KERNEL=="eth*", ATTR{address}=="00:e0:7d:fa:91:da", NAME="eth1"

```

I hope if someone has the same problem find this usefull

PD: If my english is not good is because I'm spanish  :Very Happy: .

----------

## gi1242

 *batudo wrote:*   

> I hope if someone has the same problem find this usefull

 

Thanks A TON! I had the same problem, and was looking for exactly this!

----------

## sixshot

mental note: always use lower-case when typing/pasting MAC address in there.  It took me several hours and after following a few random threads, I finally saw the note to use lower-case instead of upper-case.

While this solves the problem of udev "screwing things up" with our module-ordered configuration, I now run into a different problem.  I named my network devices as "wired" and "wireless" on this laptop of mine and got it to be named correctly.  But every time it boots up, it'd want to bring "wired" up first before "wireless".  Why?  The net.wired initscript isn't set for any startup at all.  And I only have "net.wireless" set up for "default" runlevel.  I had to force it to not do anything with "wired" by deleting the "net.wired" symlink.  It's not an elegant solution but that means I have to recreate and delete the symlink each time I use a CAT5.

Does anyone know why it keeps wanting to bring up "wired" prior to "wireless" despite that it's not set to run in the first place?

----------

## PaulBredbury

 *sixshot wrote:*   

> Does anyone know why it keeps wanting to bring up "wired" prior to "wireless" despite that it's not set to run in the first place?

 

Perhaps due to RC_NET_STRICT_CHECKING="yes" in /etc/conf.d/rc  :Question: 

----------

## sixshot

 *PaulBredbury wrote:*   

> Perhaps due to RC_NET_STRICT_CHECKING="yes" in /etc/conf.d/rc :?:

 

I went to check that and it's set to 'no'.  But according to the comments...

```

#  no    - This basically means that at least one net.* service besides net.lo

#          must be up.  This can be used by notebook users that have a wifi and

#          a static nic, and only wants one up at any given time to have the

#          'net' service seen as up.

```

Would this imply that if a service is needing 'net' that it would look to run the first net.* script inside /etc/init.d ?  It would seem plausible considering that in a directory listing sorted alphabetically "wired" would start prior to "wireless".  However, the part that bugs me is that I already have net.wireless set to run at 'default' runlevel ...

It's probably worth a mention that I haven't gotten this 'till recently when I did a massive update.  It's been several months since it's seen an update and the last gentoo-source kernel it used was 2.6.16-gentoo-r9.  Perhaps something in the startup system got changed.  Should I start messing with the rc-update command to see if I can fix it?

Edit: Well never mind that... it seems these threads solves this problem.  The RC_COLDPLUG and RC_PLUG_SERVICES variables screwed me over and I had to adapt to use these new stuff.

----------

## aussiemale

My server has two network cards, a tulip and an e100.  My problem was that every boot caused eth0 and eth1 to alternate between both cards.  Very frustrating!  This problem only started occurring with udev-103.  The entry quoted below did fix the problem (with the necessary adjustments required for the cards I use of course).

 *Quote:*   

> 
> 
> #Ethernet lan con driver r8169
> 
> DRIVERS=="ipw2200", NAME="eth0", SYMLINK="wlan"
> ...

 

Thanks richfish!

 :Very Happy: 

----------

## richcoosa19

At first I had an issue where the VM was not letting me boot because I was stupid and didn't copy over the whole folder to the destination host computer.  I finally got VMware to where it will boot the installation, but now on the new destination computer I don't have networking.  I get the following error message when i try to run a /etc/init.d/net.eth0 start I get this:

network interface eth0 does not exist

Please verify hardware or kernel module (driver)

I checked and the pcnet32 module is in the module autoload file and the module is loading:

lspci | grep net :

00:11.0 Ethernet Controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)

lsmod|grep net :

pcnet32        27268  0

So it's loading but something's still wrong....

----------

## richcoosa19

I found the problem, the interface is setup as eth1 instead of eth0, is there a way to tell the module that we want it aliased as eth0 instead of eth1?

----------

## richcoosa19

Is there a way to tell Gentoo that I want to use a certain interface with a certain card?  Like I want to use eth0 for module pcnet32....?

----------

## nixnut

merged above three posts here.

----------

