Force NIC to be 'eth0' instead of 'eth2'
Hello Everyone,
I am working on a machine which has four ethernet cards. Currently, Linux is assigning 'eth0' to one of the crappier cards. I would like to force one card to be recognized as 'eth0'. I'm guessing there is a way to bind the MAC address to the eth0 designator, but I don't know how. This is a Suse PRO 9.2 system . Could anyone give any hints? -= Stefan |
The eth# numbers are assigned by the order in which the hardware is discovered. Modprobing the cards in the order you want would give you the right numbering.
|
The eth# can be hard wired by adding the cards unique id to the config script. This is a laptop with two pcmcia cards. One is forced to eth0 and the other to eth1 one.
- Dan |
Quote:
It sounds like I want exactly this solution --- I just can't figure out how to do this from the documentation. For example, there is nothing that says 'eth0' in /etc/sysconfig/network/ifcfg.template . The Suse document /usr/share/doc/packages/sysconfig/README says that I should set these sorts of settings in /etc/udev/udev.conf --- but that's a whole other ball of wax. |
Quote:
See the Suse 9.3 Adminguide Guide at http://www-uxsup.csx.cam.ac.uk/pub/d...lug.agent.html "The best solution, however, is to use persistent interface designations. You can specify the names of the individual interfaces in the configuration files. Details about this method are available in the file /usr/share/doc/packages/sysconfig/README. Since SUSE LINUX 9.3, udev also deals with network interfaces, although these are not device nodes. This allows use of persistent interface names in a more standardized manner." |
here are the scripts
USERCTL=no IPV6INIT=no PEERDNS=yes TYPE=Wireless DEVICE=eth0 HWADDR=00:04:e2:bb:bc:ba BOOTPROTO=dhcp NETMASK= DHCP_HOSTNAME= IPADDR= DOMAIN= # ESSID=McKinley CHANNEL=1 MODE=Managed RATE='36 Mb/s' ESSID=none ONBOOT=no USERCTL=no IPV6INIT=no PEERDNS=yes GATEWAY=10.0.0.1 TYPE=Ethernet DEVICE=eth1 BOOTPROTO=none NETMASK=255.255.255.0 IPADDR=10.0.0.16 HWADDR=00:50:22:00:22:b0 ONBOOT=no |
Dan,
Thanks a bunch! Just to confirm, those are your ifcfg scripts under /etc/sysconfig/network , correct? Interestingly, I don't see the phrase "DEVICE" mentioned in the ifcfg docs :( |
The scripts were produced by the Fedora network tool.
There appear to be two duplicate copies in the /etc/sysconfig/ path. - Dan |
Do you use udev?
|
Quote:
|
Quote:
Can anyone offer hints for the udev.conf file ? |
I'm not a SUSE user (tried it, found it slow), but under Ubuntu NIC names can be bound to MAC addresses in the file /etc/iftab. I believe this config file is part of the udev package, so if SUSE 9.2 uses udev you could be in luck. See man iftab to see how to create entries in the file, but binding names to mac addresses is pretty simple:
Code:
eth1 mac 00:11:22:33:44:55 Alternatively, the man page refers to a tool called ifrename that comes with "other distributions", which may or may not include SUSE and may or may not cover what you're after. |
If no udev, then it can be done using ifrename
Have a look here: https://www.debian-administration.org/articles/463 |
I gave up trying to do this in SuSE Pro 9.2. I reinstalled CentOS 4.x on the host.
Forcing one NIC to become eth0 was very easy. I simply switched the MAC addresses in /etc/system/network-scripts/ifcfg-eth0 and ifcfg-eth2, and then rebooted. Works great! |
All times are GMT -5. The time now is 12:13 AM. |