# eth0 and eth1 swap themselves after install

## dieboy

I really don't have a question, but I'd like to report an answer that i found after a long frustrating battle.

I have a HP Pavilion ZE4900 laptop, with a built in realtek 8139c card and a broadcom 802.11g card in it.

Well during the install, my realtek nic was on eth1, i set it up under the installer for 'have inet'.  I can then open ephaniny, and browse the web fine.  IE its using the realtek nic on eth1.  Pretty simple huh?

Well I got everything installed, and all of a sudden eth1 was gone. Not installing, not preset etc. So i go and genkernel it up and make sure the correct realtek drivers are installed (8139too and 8139cp). After a kernel compile, i reboot quick and inrestingly enough, eth1 still fails.

So thinking the realtek was still on eth1 I spent about ten hours troubleshooting it.  

Sooooo the lesson is if you install with the livecd, and are dealing with two nics, sometimes (for whatever messed up reason) after the install, eth1 and eth0 will have swapped.  If you having problems similiar, its well worth to try to load up the other eth and see if its the one your trying to setup.

Good Luck and Cheers!

dieboy

----------

## NeddySeagoon

dieboy,

The reason for eth0 and eth1 swapping is that the logical interface names are assigned in the order that the interfaces are initialised. There are several mechanisms at work.

Interfaces built into the kernel are initialised before modules are loaded.

Modular interfaces are initialised in modular load order.

The above can provide a degree of control but the right way to fix this is to assign interface names based the MAC address by writing udev rules.

----------

## dieboy

Thanks,  that would make perfect sense. I just never thought of it that way.  Partly because i've never had two nics installed at once, or two of anything really except hds.  

I'll have to look into udev rules, right now its working great and i'm a happy camper  :Smile: 

----------

## PaulBredbury

See udev guide  :Wink: 

----------

## deface

and/or check out 

/etc/udev/rules.d/70-persistant-net.rules

----------

