Redhat (RHEL) 6x Interfaces name keep changing

Posted on March 7, 2014

0


Recently I faced that the Network Interface names keep changing after reboot.

on a computer having two network cards made by Intel and Realtek, the network card manufactured by Intel may become eth0 and the Realtek card becomes eth1. In some cases, after a reboot the cards get renumbered.

# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”e0:cb:4e:08:e7:f8″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”ETHERNET”

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:19.0 (e1000e)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:1f:29:8a:c6:65″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″

# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.1/0000:10:00.0/ssb0:0 (b43-pci-bridge)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:21:00:17:24:d4″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”wlan*”, NAME=”wlan0″

# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.1/0000:10:00.0 (wl)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:21:00:17:24:d4″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1″

#
# Now replace the existing name with the name you need to be persistent name of your NIC. For example add the name of NIC instead of eth0      NAME=”eth0

Please Note:

– Make a backup copy of (/etc/udev/rules.d/70-persistent-net.rules ) before editing.

– You may also try to create another fine name (/etc/udev/rules.d/71-persistent-net.rules ) and change this file.I thought that if  file name (/etc/udev/rules.d/70-persistent-net.rules ) keep change by RHEL, the file (/etc/udev/rules.d/71-persistent-net.rules ) will keep unchanged.

TIP: Stop NetworkManager service (service NetworkManager stop) if it bothers you and manage the ETHERNETs from /etc/sysconfig/network-script/ifcfg-ethx. Sometimes it happens that you don’t find the ifcfg-ethx file but when you delete the file (/etc/udev/rules.d/70-persistent-net.rules ) and restart the system it shows you then. else you stop NetworkManager and create a new file with the name ifcfg-eth1, ifcfg-eth1 and set the MAC, STATIC,IPADDR,NETMASK etc for that newly generated file

Advertisements
Posted in: Linux