nameif fix for RedHat

There is a handy utility that comes with most Linuxes called nameif. This program renames a network interface such as eth0 to a specifiable string of 1-15 characters based on the MAC address. For example
nameif dmz 18:66:0B:00:E0:22
would find a network card with the matching MAC address and rename the interface to dmz. To use this interface you would now type ifup dmz.

RedHat Linux attempts to use the nameif utility to match up an network card that is brought up in the wrong order. The implementation does not work well because the other cards may already be initialized so naming conflicts occur. This always happens in the case of multiple cards initialized by the same driver before calling nameif.

We have taken another approach. Stop using eth0, eth1, etc. We have renamed the interfaces to be something that makes sense. For firewalls we use internal, external, and dmz. Since we link the name to the MAC address the same name will always be used no matter what drivers are used or which order the cards are initialized in. Also stickers can be placed on the backs of the cards so that users will always know which cable to plug in. EVEN IF, the cards are moved around in the case, they will still have the same name.

To use this method effectively,

  1. rename /etc/sysconfig-network-scripts/ifcfg-eth0 to ifcfg-myinterface
  2. repeat for each interface using whatever names are desired
  3. edit /etc/modules.conf and change eth0 to myinterface
  4. repeat with other interfaces
  5. apply our patches or files to redhat's networking scripts. (hopefully they will accept our changes because they work better than the original and are backwards compatible)

Caveats
You can use any string except those that are listed when running 'ip -o link'. RedHat uses this command in the networking scripts. So dont use:
lo: LOOPBACK,UP mtu 16436 qdisc noqueue link loopback brd eth0: BROADCAST,MULTICAST,NOTRAILERS,UP mtu qdisc pfifo_fast qlen link ether brd ipsec0: NOARP mtu qdisc noop qlen link/ipip


If you would like to contact us, please fill out our web form.

Xperience, Inc. Home     |      Return to .org