Changing Ethernet Device Names in EL7 and Fedora 15+

From Alteeve Wiki
Revision as of 12:52, 7 October 2012 by Digimer (talk | contribs)
Jump to navigation Jump to search

 AN!Wiki :: How To :: Changing Ethernet Device Names in EL7 and Fedora 15+

Warning: The topic includes RHEL v7, which has not be released. It may well prove that the methods described here will not work with the final release of Red Hat Enterprise Linux version 7. Best guesses on how things will work inform this tutorial and may prove wrong.
Warning: This is not finished and may well contain errors and omissions. Proceed with caution! Better yet, don't proceed at all. :)

Traditionally in Linux, network devices were given the name ethX, where X was a digit starting at 0 and incremented up. The drawback to this was that there was no consistent or deterministic way to know which physical network ports would get which ethX name. To address this, Fedora 15 (and other distributions) began using a new tool called biosdevname which names each network device based on where it is found in the system. The result is that, usually, you can predict the name of a given physical interface.

This tutorial will show you how to change these device names to anything you would like. This tutorial is not meant to advocate against the new network naming. However, there are cases ranging from simple familiarity to application compatibility that might make you want to use different network device names. For those cases, this tutorial hopes to help you.

Assumptions

This tutorial makes a few assumption which may not apply to your system. Please adjust accordingly.

This tutorial assumes you have six network cards;

  • p1p1
  • p1p2
  • p2p1
  • p2p2
  • p4p1
  • p4p2

We will rename these to;

  • bcn1
  • bcn2
  • sn1
  • sn2
  • ifn1
  • ifn2

The reason for these names is that, in my case, I wish to give names to interfaces that reflect their purpose in my servers. Specifically, I need three bonded networks; BCN, SN and IFN in my clusters. You can just as easily use eth0 to eth5 or any other name that suits your purposes.

This tutorial also assumes that you have a minimal install and that the system is designed to be a server. As such, NetworkManager is removed and the network daemon will be used. No attempt was made to test if the method of renaming network devices shown here works with NetworkManager.

Overview

We will need to take the following steps;

  1. Identify the network device names assigned to each interface.
  2. Generate the /etc/udev/rules.d/70-persistent-net.rules file.
  3. Unplug and plug back in each network interface to create the map of current to desired names.
  4. Rename and edit the /etc/sysconfig/network-scripts/ifcfg-X files to reflect the desired names.
  5. Edit the /etc/udev/rules.d/70-persistent-net.rules file to create the MAC address to device name maps.
  6. Restart the machine to make the changes take effect.

Identify Interfaces

Current Name Desired Name
p2p2 bcn1
p2p1 bcn2
p1p2 sn1
p4p1 sn2
p1p1 ifn1
p4p2 ifn2

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.