Networking Forums

Networking Forums > Computer Networking > Linux Networking > fix a particular network card as ethx

Reply
Thread Tools Display Modes

fix a particular network card as ethx

 
 
Ming-Ching Tiew
Guest
Posts: n/a

 
      05-02-2006, 09:28 AM
If I have two network card ( PCI same model ), instead of letting system
auto assign a network card as ethx, is there a way for me to fix it ?



 
Reply With Quote
 
 
 
 
David Goodenough
Guest
Posts: n/a

 
      05-02-2006, 10:20 AM
Ming-Ching Tiew wrote:

> If I have two network card ( PCI same model ), instead of letting system
> auto assign a network card as ethx, is there a way for me to fix it ?

udev (this is assuming you are running a reasonably recent 2.6 kernel).
Its rules allow you to assign names to particular cards by MAC address or
by PCI-bus-location.

David
 
Reply With Quote
 
Ming-Ching Tiew
Guest
Posts: n/a

 
      05-03-2006, 01:25 AM

"David Goodenough" <(E-Mail Removed)> wrote in message news:445733dd.0@entanet...
> Ming-Ching Tiew wrote:
>
> > If I have two network card ( PCI same model ), instead of letting system
> > auto assign a network card as ethx, is there a way for me to fix it ?

> udev (this is assuming you are running a reasonably recent 2.6 kernel).
> Its rules allow you to assign names to particular cards by MAC address or
> by PCI-bus-location.
>


But unfortunately I am using 2.4 kernel.


 
Reply With Quote
 
M
Guest
Posts: n/a

 
      05-03-2006, 03:37 AM
Ming-Ching Tiew wrote:

>
> "David Goodenough" <(E-Mail Removed)> wrote in message
> news:445733dd.0@entanet...
>> Ming-Ching Tiew wrote:
>>
>> > If I have two network card ( PCI same model ), instead of letting
>> > system auto assign a network card as ethx, is there a way for me to fix
>> > it ?

>> udev (this is assuming you are running a reasonably recent 2.6 kernel).
>> Its rules allow you to assign names to particular cards by MAC address or
>> by PCI-bus-location.
>>

>
> But unfortunately I am using 2.4 kernel.


I know in Red Hat, you can set the files for each interface
to bond to the particular card by identifying the card by
it's unique hardware address, the files:

/etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1
have an option field called HWADDR, while your linux machine
is up, look at ifconfig eth0 and ifconfig eth1 commands output
to get what the card's hardware addresses are, then put
those addresses in the particular ifcfg-eth0 or ifcfg-eth1
file you want that card to be.

Reference:
https://lists.sdsc.edu/pipermail/npa...ly/006814.html

Mark
 
Reply With Quote
 
Ming-Ching Tiew
Guest
Posts: n/a

 
      05-03-2006, 06:33 AM

"M" <notspam@spam7_14a.com> wrote in message news:YzV5g.1812$g01.523@trnddc01...
>
> /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1
> have an option field called HWADDR, while your linux machine
> is up, look at ifconfig eth0 and ifconfig eth1 commands output
> to get what the card's hardware addresses are, then put
> those addresses in the particular ifcfg-eth0 or ifcfg-eth1
> file you want that card to be.
>
> Reference:
> https://lists.sdsc.edu/pipermail/npa...ly/006814.html
>


I have read the reference you mentioned but I am finding it strange
how this is possible. Surely, if this is at all possible, redhat
must be using some tools which could map ethx to a particular
physical mac address. And this is my question, what is the tool
which make this possible. Surely this is not a matter of shell
script.

Thanks for the info.



 
Reply With Quote
 
Mark
Guest
Posts: n/a

 
      05-03-2006, 09:10 PM
Ming-Ching Tiew wrote:
> "M" <notspam@spam7_14a.com> wrote in message news:YzV5g.1812$g01.523@trnddc01...
>
>>/etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1
>>have an option field called HWADDR, while your linux machine
>>is up, look at ifconfig eth0 and ifconfig eth1 commands output
>>to get what the card's hardware addresses are, then put
>>those addresses in the particular ifcfg-eth0 or ifcfg-eth1
>>file you want that card to be.
>>
>>Reference:
>>https://lists.sdsc.edu/pipermail/npa...ly/006814.html
>>

>
> I have read the reference you mentioned but I am finding it strange
> how this is possible. Surely, if this is at all possible, redhat
> must be using some tools which could map ethx to a particular
> physical mac address. And this is my question, what is the tool
> which make this possible. Surely this is not a matter of shell
> script.
>
> Thanks for the info.


I think it is done by shell scripts but it also uses
a command line program or two (ip, nameif), quoting this from
/etc/sysconfig/network-scripts/ifup-eth:

# remap, if the device is bound with a MAC address and not the right
#device num bail out, if the MAC does not fit
if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`get_hwaddr ${REALDEVICE}`
if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
curdev=`ip -o link | awk -F ':' -vIGNORECASE=1 "/$HWADDR/ {
print \\$2 }"`
if [ -n "$curdev" ]; then
rename_device "${REALDEVICE}" "${HWADDR}" "${curdev}" || {
echo $"Device ${DEVICE} has different MAC address than
expected, ignoring."
exit 1
}
fi
fi
fi
=========

rename_device uses /sbin/nameif to actually assign the interface
to address relationship (see man nameif )

I've got a SBS Technologies VR-9 board at work running Fedora 4 that
has two identical Intel e1000 ports for eth0 and eth1 and I looked in
/etc/sysconfig/network-scripts and the ifcfg-eth0 and ifcfg-eth1
files were autoconfigured at install time to have the two
unique HWADDR entries in there for the two i/f's. I don't use
the eth1 and have it deactivated by putting alias eth1 off in the
modprobe.conf file but the OS never has incorrectly put the
eth0 on the wrong port.

Mark
 
Reply With Quote
 
Vilmos Soti
Guest
Posts: n/a

 
      05-03-2006, 10:15 PM
"Ming-Ching Tiew" <(E-Mail Removed)> writes:

> If I have two network card ( PCI same model ), instead of letting system
> auto assign a network card as ethx, is there a way for me to fix it ?


ifrename.

Vilmos
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intel Driver e1000e-0.5.11.2... compiles and loads fine, but can't setup ethX...? trashcan@wopr.de Linux Networking 5 02-26-2009 09:08 PM
Test for configured ethX CptDondo Linux Networking 1 03-29-2007 04:24 PM
determining which card is which ethX interface spip_yeah@yahoo.com Linux Networking 10 11-08-2006 02:20 PM
pegasus USB ethernet driver loading but no ethX interface Paul Gratz Linux Networking 0 10-15-2004 04:30 PM
Binding of ethX to the interfaces. Dan McDaid Linux Networking 8 07-06-2004 08:12 PM



1 2 3 4 5 6 7 8 9 10 11