LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-09-2012, 07:31 AM   #1
hokie1999
Member
 
Registered: Feb 2011
Posts: 36

Rep: Reputation: 0
ethernet card position in server


What determines the name of an ethernet interface like eth0? Is eth0 always linked to the first card in the server? Or is it the MAC address in the ifcfg-eth0 file that determines position?

For instance, say there are two cards in a server. The MAC address of the left (first) card is A, the MAC address of the right (second) card is B. If I create an ifcfg-eth0 that contains HWADDR=B does that make the second card eth0?

Pardon if this has been asked before.
 
Old 03-09-2012, 08:21 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
The MAC address is the key. You can logically "move" NICs by switching MAC addresses.

You want to be sure that you only have a given MAC in one config file at a time. Be sure not to make copies like "ifcfg-eth0.bak" or "ifcfg-eth0.20120309" as any file starting with ifcfg will be read during network start/stop (including reboots) and can cause issues if the same MAC is found in more than one. To save copies you can put them in /root or prepend the backup name (e.g. bak.ifcfg-eth0 or 20120309.ifcfg-eth0).
 
Old 03-09-2012, 08:43 AM   #3
hokie1999
Member
 
Registered: Feb 2011
Posts: 36

Original Poster
Rep: Reputation: 0
OK I agree.

What about bonding? When I say bonding, with eth0 and eth1 as an example, most howtos will not include MAC addresses. Example from linux-corner.info below. (BTW I am running a Oracle Enterprise Linux 5 4 on HP blade ProLiant BL460c G6). My question is: How does bonding know the MAC address of the eth cards?


bond0

DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MII_NOT_SUPPORTED=yes

and eth0 and eth1 are

DEVICE=ethx
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
MII_NOT_SUPPORTED=yes

Thanks for your knowledge on this.
 
Old 03-09-2012, 08:53 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
There should be a "HWADDR=" for MAC in each of the slave interface ifcfg files (e.g. ifcfg-eth1, ifcfg-eth2) that should be different. It should NOT be in the bond ifcfg file (e.g. ifcfg-bond0).

Typically the bond when seen in ifconfig will show the MAC address of the first slave interface. Depending on bonding mode you might actually see the same MAC on slaves in ifconfig even though they are actually different in the ifcfg files. Actually that is what I was used to on RHEL5 with bonding mode 0 using two NICs. Recently I realized a RHEL6 server using bonding mode 6 with three NICs shows the MAC addresses all different. But it still shows bond0 with same MAC as first NIC slave.
 
Old 03-09-2012, 08:54 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
When udev first detects the NICS it writes /etc/udev/rules.d/70-persistent-net.rules with lines like
Code:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:9d:a1:42", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
This ensures that it subsequently assigns the same eth<n> to the NIC based on its MAC address as MensaWater wrote.

EDIT: RHEL might do things differently.

Last edited by catkin; 03-09-2012 at 08:58 AM. Reason: hit the post button too soon
 
Old 03-09-2012, 09:18 AM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
@hokie1999, I'd add: ignore the examples you reviewed. Do specify HWADDR for your bond device slaves.
 
Old 03-09-2012, 10:42 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
Quote:
Originally Posted by anomie View Post
@hokie1999, I'd add: ignore the examples you reviewed. Do specify HWADDR for your bond device slaves.
That is ONLY the slaves and not the bond device itself as previously noted.
 
Old 03-09-2012, 11:32 AM   #8
hokie1999
Member
 
Registered: Feb 2011
Posts: 36

Original Poster
Rep: Reputation: 0
It's interesting that with my company's servers, a MAC is placed in one of two slave ifcfg files and the bond seems to work. I was told that the Oracle howto on bonding did not work and the engineer who configured this used a Red Hat tutorial. No matter, thanks for the input. @catkin, there is no persistent.net.rules on OEL 5 4; that must be a slackware attribute. It is present on Centos.
 
Old 03-09-2012, 11:47 AM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater
That is ONLY the slaves and not the bond device itself as previously noted.
Agreed.
 
Old 03-09-2012, 08:02 PM   #10
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
OEL is derived from RHEL as is CentOS.
 
Old 03-09-2012, 10:22 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,000

Rep: Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513
A nic name 0 is not guaranteed to be some position. We have battled that for decades.

The current push is to identify nic cards by their position in the system. So get ready for the next way to id them. It is supposed to make the admin's job easier.
 
  


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
New ethernet card hangs the server when doing ifconfig down. Drivers conflicting? permalac Linux - Hardware 0 08-11-2011 06:36 AM
Ethernet card not recognized - Ubuntu Server Smig Linux - Hardware 6 02-12-2008 12:09 PM
Problem with ethernet card [Marvel Yukon Ethernet controller] in Fedora 4 me4linux Linux - Hardware 3 03-28-2007 02:39 PM
ethernet card SiS 900-Based PCI Fast Ethernet Adapter Not Detected pathan_azhar Linux - Networking 0 08-13-2006 04:15 AM
Ethernet card on laptop: I installed my D-Link ethernet card into Redhat 9, not detec brighamr Linux - Hardware 0 05-18-2004 12:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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