Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-30-2010, 02:32 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 9

Rep: Reputation: 0
eth0 or eth1

I've noticed that when Linux boots on different machines or with different versions, the network card is assigned to eth0 or to eth1, when there is only one network card.
What is the difference and is there any way to tell which one it will be for any machine or version?
Old 11-30-2010, 02:58 PM   #2
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 142Reputation: 142
Udev loads modules asynchronously, so devices can be initialized in different orders, leading to the name switch. You can set a udev rule to fix the problem. This Debian page has an example for setting a fixed eth0, eth1, and eth2.
Old 11-30-2010, 04:14 PM   #3
Registered: Mar 2008
Posts: 16,883

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
I have only seen 1 picked if the motherboard had some parts of a onboard nic, even if not able to be used in bios or though hardware.

If only one card exists it should have started at 0.
Old 11-30-2010, 04:24 PM   #4
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Note that depending on what age is your GNU/Linux distro, and thus what version of UDEV you are running, may affect the syntax of udev rules. In case it helps further, here are a couple of rules I'm using now on my Slackware machine (Slackware -current, udev 164) to keep eth0 and eth1 the way I want them:
# PCI device 0x10de:0x0269 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="06:39:db:b5:9a:g2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1317:0x0985 (tulip)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="04:hf:af:d7:66:2e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Each device is being identified uniquely by its MAC address, and assigned appropriately.

Last edited by GrapefruiTgirl; 11-30-2010 at 04:25 PM.


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
Production server with static IPs on eth0 and eth0:1 - need private LAN on eth1 stardotstar Linux - Networking 8 07-03-2010 12:27 AM
Eth0 using DHCP and eth1 using static ip: eth0 receive internal ip not the router ip geraldomanaus Linux - Networking 3 04-23-2008 03:00 PM
howto acess intrnet thru eth1(wireless card)in winXP via briging in linux(eth0-eth1) labhesh_popli Linux - Wireless Networking 1 09-21-2006 01:11 AM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09: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