Operating System - Linux
1752657 Members
5624 Online
108788 Solutions
New Discussion юеВ

Re: Re-ordering Network Cards...

 
Lee Harris_5
Valued Contributor

Re-ordering Network Cards...

Hi, I have a DL585 G2 with 6 NICs (two onboard and 2 x dual port cards). After the server has booted into RHEL-AS-4-U4 the order of the cards is incorrect.

The two onboard should be eth0 and eth1 with the PCI cards being eth2, 3, 4 and 5. At the moment however, it seems that the two onboard ones are eth4 and 5.

Can anyone tell me how I can change the order of them? They are all NetXtreme II cards using the bnx2 driver.

Thanks - Lee
14 REPLIES 14
Court Campbell
Honored Contributor

Re: Re-ordering Network Cards...

Here is a link for modifying udev:

http://www.debianhelp.co.uk/udev.htm

It should apply to red hat also. Follow the notes up to the point "Updating network configuration", then reboot. If you have time you should look into udev. Here is another good link to learn a little more about it:

http://www.redhat.com/magazine/002dec04/features/udev/
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Ivan Ferreira
Honored Contributor

Re: Re-ordering Network Cards...

You could set HWADDR in /etc/sysconfig/network-scripts/ifcfg-ethX, for example:

/etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=static
HWADDR=ZZ:YY:XX:WW:VV:UU
IPADDR=aaa.bbb.ccc.ddd
IPV6ADDR=
IPV6PREFIX=
NETMASK=255.255.255.0
ONBOOT=yes
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: Re-ordering Network Cards...

Shalom,

This is difficult and can even make your system unstable..

Based on other issues posted you have better things to do with your time.

I even once went to the trouble of deactivating the NIC cards in the bios on a HP server and then installing the OS but they were still detected and eth numbers reserved.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Lee Harris_5
Valued Contributor

Re: Re-ordering Network Cards...

Thank you so far for the replies. Court's links were helpful, but despite following the instructions, it didn't actually seem to make any difference.

Changing the ifcfg-eth* scripts doesn't work, this will just end up spoofing the MAC addresses and will probably end up quite messy.

Although this doesn't make any difference to the functionality of the server it is annoying. It would be nice to be able to tell how Linux maps physical hardware to devices. I need to try and keep the network card layout and settings to the same standard as the other machines. Unfortunately the other machines are predominantly DL585 G1's which don't seem to have a problem.
Ivan Ferreira
Honored Contributor

Re: Re-ordering Network Cards...

>>> this will just end up spoofing the MAC addresses and will probably end up quite messy.

I totally disagree. Please note the difference between these parameters:

HWADDR=, where is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive is useful for machines with multiple NICs to ensure that the interfaces are assigned the correct device names regardless of the configured load order for each NIC's module. This directive should not be used in conjunction with MACADDR.

MACADDR=, where is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive is used to assign a MAC address to an interface, overriding the one assigned to the physical NIC. This directive should not be used in conjunction with HWADDR.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Lee Harris_5
Valued Contributor

Re: Re-ordering Network Cards...

Ivan, sorry I misread your original reply. However, I have changed the device settings as you suggested, and this has sort of made a difference, but not quite what I am after. What should be eth4 and eth5 now have been renamed dev#####....see below output from command "ip a s"

1: lo: mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: dev18319: mtu 1500 qdisc noop qlen 1000
link/ether 00:19:bb:d2:33:64 brd ff:ff:ff:ff:ff:ff
3: dev32316: mtu 1500 qdisc noop qlen 1000
link/ether 00:19:bb:d2:33:66 brd ff:ff:ff:ff:ff:ff
4: eth2: mtu 1500 qdisc noop qlen 1000
link/ether 00:1a:4b:4f:ad:4c brd ff:ff:ff:ff:ff:ff
5: eth3: mtu 1500 qdisc noop qlen 1000
link/ether 00:1a:4b:4f:ad:4e brd ff:ff:ff:ff:ff:ff
6: eth0: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:18:fe:76:64:50 brd ff:ff:ff:ff:ff:ff
inet 164.39.8.144/24 brd 164.39.8.255 scope global eth0
inet6 fe80::218:feff:fe76:6450/64 scope link
valid_lft forever preferred_lft forever
7: eth1: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:18:fe:76:64:52 brd ff:ff:ff:ff:ff:ff
inet 10.210.254.120/24 brd 10.210.254.255 scope global eth1
inet6 fe80::218:feff:fe76:6452/64 scope link
valid_lft forever preferred_lft forever
8: sit0: mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0

I want to actually change the order in which RedHat detects the NICs rather so it ends up like:

0: lo:
1: eth0:
2: eth1:

...and so on.

Regards - Lee
Matti_Kurkela
Honored Contributor

Re: Re-ordering Network Cards...

If you make the old eth4 become the new eth0, you should also use HWADDR to explicitly specify what the new name of the old eth0 should be.

If you don't do that, you get generic place-holder names just like you experienced. The placeholders are automatically generated so that they are guaranteed not to overlap.

MK
MK
Alexander Chuzhoy
Honored Contributor

Re: Re-ordering Network Cards...

Court Campbell
Honored Contributor

Re: Re-ordering Network Cards...

Just curious. What did you put in the udev rules file?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"