LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-30-2010, 03:32 PM   #1
GordonAkst
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?
Thanks.
Gordon
 
Old 11-30-2010, 03:58 PM   #2
reed9
Member
 
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, 05:14 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
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, 05:24 PM   #4
GrapefruiTgirl
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:
Code:
# 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 05:25 PM.
 
  


Reply


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 01: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 04: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 02:11 AM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 01: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 08:32 PM


All times are GMT -5. The time now is 02:48 AM.

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