Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 10-15-2003, 05:34 PM   #1
Registered: Nov 2002
Posts: 668

Rep: Reputation: 30
eth0 & eth1 switched

I thought this was kind of interesting, and I wanted to see what others thought of it.

I have two NICs in my Slack 9 box. I do't think it matters much, but I'll give the info anyway:
  • eth0: RealTek 8139
  • eth1: Netgear MA311 Wireless
Both cards worked flawlessly.
Anyway, I installed Slack 9.1 and all went well. Then booting the first time I noticed that I was pulling the DHCP for my internet connection. All the correct modules were loaded, and lspci showed both of the cards as should be. What I figured out by running iwconfig that my new OS switched the two cards, eth1 was now eth0, and vice versa.
I pulled the wireless card out and rebooted, letting it pick up the first card, and then put it back in and now everything is back to normal.

My question is this: What during the boot process determines the eth0/1 designation? Is it just a fluke and whichever card the kernel finds first gets the first device designation? Has anyone else run across this?

I just thought it was interesting.......
Old 10-16-2003, 02:05 AM   #2
Senior Member
Registered: May 2003
Location: /var/log/cabin
Distribution: All
Posts: 1,167

Rep: Reputation: 45
Yes, it goes in the order of pci slots. cat /proc/pci

It's a bitch when you want to router packets away from eth0 in apps. In fact, I've never gotten it to work. But, yea, the order is physical and set at boot. You can alter the config though, not horrible to do, but not as smooth to configure as I would like personally.
Old 10-16-2003, 08:36 AM   #3
Senior Member
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
I suspect the order can be changed by soft config. For example if you put

alias eth0 realtek
alias eth1 wireless

(or whatever the driver modules are called) in /etc/modules.conf then I would think that is what you get. Alternatively if you list the modules in /etc/modules to load at startup then I would think eth0 and eth1 are assigned in the same order they are listed. Worth a try if you need it anyway.
Old 10-17-2003, 11:53 PM   #4
Registered: Mar 2001
Location: India
Posts: 332

Rep: Reputation: 30

Also Make the initrd image after changing the order if requied..

Old 10-18-2003, 12:23 AM   #5
Registered: Nov 2002
Posts: 668

Original Poster
Rep: Reputation: 30
Thumbs up

Thx everyone. All good info.
Old 12-12-2003, 08:59 AM   #6
Registered: May 2003
Distribution: slack,gentoo
Posts: 57

Rep: Reputation: 16
are you sure it goes in the order of pci slots? I've changed them, when I do cat /proc/pci I can see the order has changed but they get still the same eth#, I had to compile modules for those cards instead compiling the support into the kernel, and then the eth# goes in the order I load the modules for adapters.
I'm curious, what if I have two same adapters (so only one module is loaded), how does the system number it?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i assign/switch eth0 & eth1 the-sloth Linux - Networking 10 02-05-2011 12:48 PM
eth0/eth1 switched in FC3 hairydan Linux - Networking 8 03-07-2005 10:48 AM
Eth0 & Eth1 boot start Up FAILED.. PAOLO_GRS Linux - Networking 1 09-03-2004 07:18 PM
Swapping eth0 & eth1? sarah_t_s Slackware 6 07-25-2004 11:14 AM
how to set which NIC is eth0, & which is eth1 roshko Linux - Networking 4 09-01-2003 11:08 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration