I have a Centos 7 system where I've disabled the new network naming system and reverted to the old system (eth0, eth1, etc.). I've done this because I'm using this in an RDO Openstack setup, and this needs the same ethernet device names on a few different hosts. Some of these hosts are virts under kvm and use the eth naming system.
Since doing this, every few reboots, my ethernet devices get flipped around.
On a healthy boot, I see
[ 11.172339] tg3 0000:03:00.0 eth0: Tigon3 [partno(BCM95723) rev 5784100] (PCI Express) MAC address 68:b5:99:72:d8:02
[ 11.269599] e1000e 0000:02:00.0 eth1: (PCI Express:2.5GT/s:Width x1) 68:05:ca:04:90:16
On a 'bad boot', those will be flipped around and the e1000e will be eth0 with the tg3 being eth1.
I've done the following so far:
- Added "net.ifnames=0 biosdevname=0" to the GRUB_CMDLINE_LINUX line in /etc/default/grub
- grub2-mkconfig -o /boot/grub2/grub.cfg
- created /etc/udev/rules.d/70-persistent-net.rules
After running the grub2-mkconfig, I see the following in /boot/grub2/grub.cfg (which implies my change above is taking effect)
linux16 /boot/vmlinuz-3.10.0-123.el7.x86_64 root=UUID=eabee081-85f8-4f33-b72a-fbbdc575e010 ro vconsole.keymap=uk crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb net.ifnames=0 biosdevname=0 quiet
The contents of 70-persistent-net.rules are as follows:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="68:B5:99:72:D8:02", ATTR{type}=="1", KERNEL=="eth", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="68:05:CA:04:90:16", ATTR{type}=="1", KERNEL=="eth", NAME="eth1"
I've also tried changing the letters in the MAC addresses in this file to lowercase to match the output of dmesg. This makes no difference.
I have NetworkManager disabled and I have the HWADDR entry in /etc/sysconfig/network-scripts/ifcfg-eth*.
Under ubuntu and earlier versions of Centos, the above works fine and reliably.
None of this is leading to predictable devices on this box with Centos 7 though.
Any advice on how to pin these devices to the eth names would be much appreciated!
ethX
. You could usenetX
ormydevice
orbestnetworkcard1
but noteth0
,eth1
, etc. Give that a go. – suprjami Jan 15 '15 at 4:52