0

On one of the CentOS Linux release 7.6.1810 (Core) server the mac address's of networfaces got changed e.g. eth0 has eth3's mac address and so on . Does anyone know why this happens and how to resolve it ?

3

For whatever reason, your system has disabled consistent network device naming. This means that instead of using modern device names for interfaces, which remain the same for each NIC, on every boot your NICs may come up with a random eth* identifier that you cannot predict.

You should re-enable consistent network device naming, and then reconfigure the NICs with their new consistent names, which will remain the same unless you physically change the hardware. If present, the boot command line options net.ifnames=0 and biosdevname=0 should be removed. If they were not present, then only net.ifnames=1 should be set.

You also should read the entire RHEL documentation chapter linked above, including the troubleshooting section, before beginning. This is a pretty invasive change and will require some downtime, but once complete it will solve the problem for the remaining life of the server hardware.

0

NetworkManager probably did that. To prevent it in the future, just disable it if you're not specifically using it for something. Otherwise, save your configurations so you can restore them later.

# systemctl disable NetworkManager
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'

To fix things up, Edit file /etc/default/grub and add net.ifnames=0 biosdevname=0 to line GRUB_CMDLINE_LINUX, then re-make a GRUB configuration file and overwrite existing one:

# grub2-mkconfig -o /boot/grub2/grub.cfg

Edit NAME and DEVICE parameters in ifcfg file to new Network Interface name.

# cat /etc/sysconfig/network-scripts/ifcfg-eno1

......
NAME=eth0
DEVICE=eth0
......

Edit ifcfg file name:

# mv /etc/sysconfig/network-scripts/ifcfg-eno1 /etc/sysconfig/network-scripts/ifcfg-eth0

Repeat as needed for all eth-s.

As long as NetworkManager is off, nothing will mess them around anymore.

1
  • This problem is caused by net.ifnames=0 biosdevname=0. – Michael Hampton Jun 24 '20 at 13:26
0

Adding MACADDR field in interface files fixed it for me. As explained in https://access.redhat.com/solutions/70215

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.