beautypg.com

Sample scripts, Reference – Dell 1U Rackmount LED Console User Manual

Page 8

background image

Names to Consistent Device Names for Ethernet Devices in Red Hat® Enterprise Linux® v6

8

c. If the firewall is not active and you have the firewall rules defined, use the

configuration from /etc/sysconfig/iptables:

# cp /etc/sysconfig/iptables /tmp/iptables-old-names

d. Edit /tmp/iptables-old-names and replace each occurrence of ethN with the

corresponding emX/pXpY name based on the map.

e. Replace /etc/sysconfig/iptables with /tmp/iptables to load the rules during

subsequent reboots.

# cp /tmp/iptables /etc/sysconfig/iptables

6. Update other miscellaneous files. For each of the other files that use the traditional ethN

names, search and replace each occurrence of ethN names with emX or pXpY names. There is a
sample script that you can use, see the

Sample Scripts

section.

7. Delete the file /etc/due/rules.d/70-persistent-net.rules.

f. rm /etc/due/rules.d/70-persistent-net.rules

8. Reboot and make sure that the network devices, services, and firewall rules start up as

expected—there should be no references to the older ethN names.

# ls /sys/class/net/
em1 em2 em3 em4 lo
# ip link show
...
# iptables-save | less
...

Sample Scripts

We have provided two sample scripts for migrating network information. Download the scripts at

linux.Dell.com

.

eth2em-map.sh

This script creates a map of the old name, the corresponding new name, and
the MAC address for each of the Ethernet interfaces on the system as reported
by biosdevname. Use the output to assist with changing the network
configuration, firewall rules, and so on. Run this script on a system that is
currently using the ethN names and save/print the output for use later.

eth2em-rename.sh

This script uses the map created by eth2em-map.sh and replaces every
occurrence of an ethN name with its corresponding emX or pXpY name, saving
the output file as em_.

Reference

1.

Consistent Network Device Naming in Linux