Traditional Network Interface Naming Scheme Vs. Persistent Naming
Hi,
I’m currently experimenting with CentOS 7 in order to get a grasp of everything that’s new.
After having read the FAQ entry on network interface names, I decided to revert to the tradictional interface naming scheme by adding the relevant kernel options to the bootloader. This went well, I have now two interfaces names ‘eth0’ and ‘eth1’ as expected.
In my office I have another server with two network interface cards, running Slackware64 14.1. On a stock Slackware installation, as soon as there is more than one NIC, the system creates a file
/etc/udev/rules.d/70-persistent-net.rules, which looks like this:
# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0
(e1000e)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”2c:27:d7:15:54:a1″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0
(e1000e)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:22:64:8a:4c:c2″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1″
Usually I have a 50 % chance of getting the network interface right
(well, according to Murphy, I have more like a 100 % chance of getting it wrong the first time :oD). In that case, I simple edit the
70-persistent-net.rules file, permutate the “eth0” and “eth1” entries and then reboot.
How would I go about that under CentOS with traditional interface names?
The 70-persistent-net.rules file doesn’t exist. Do I have to create it from scratch?
Cheers,
Niki Kovacs
—
Microlinux – Solutions informatiques 100% Linux et logiciels libres
7, place de l’église – 30730 Montpezat Web : http://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32
3 thoughts on - Traditional Network Interface Naming Scheme Vs. Persistent Naming
Those are udev rules (which’s now integrated with systemd in CentOS 7).
You don’t have to create a new one, but you have to find the one. I
suggest reading up on the udev rules file.
Probably more than you want to know about this weirdness and the multiple ways of doing it:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/Networking_Guide/Red_Hat_Enterprise_Linux-7-Networking_Guide-en-US.pdf
Le 04/02/2015 18:48, m.roth@5-cent.us a écrit :
LOL !!!
After a bit more experimenting, looks like I’ve found a clean solution for this. Simply create the /etc/udev/rules.d/70-persistent-net.rules file from scratch and edit it like this:
# /etc/udev/rules.d/70-persistent-net.rules
#
# eth0
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, \
ATTR{address}==”00:1e:c9:42:84:7b”, ATTR{type}==”1″, \
KERNEL==”eth*”, NAME=”eth0″
# eth1
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, \
ATTR{address}==”00:30:f1:6a:2f:40″, ATTR{type}==”1″, \
KERNEL==”eth*”, NAME=”eth1″
Reboot, and everything’s working as expected.
Cheers,
Niki
—
Microlinux – Solutions informatiques 100% Linux et logiciels libres
7, place de l’église – 30730 Montpezat Web : http://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32