Friday, June 16, 2017

RHEL7 / CentOS7 network interface going down once per hour

There's really bizarre bug in RHEL7 / CentOS7. Once per hour NetworkManager will remove IP addresses from ethernet interface after hitting some bug and triggering "link loss" action. Interface may come back by itself or may not. It does come back when you login as root on console as login triggers some repair action part via systemd...



This bug has been there for quite a while since oldest report of exactly same problem is from May 2015 with Hyper-V. Luckily for me someone figured out bit more details of this problem in February 2017 running KVM. I'm using ESXi so it's obviously not virtualization platform related.

Edit /etc/default/grub GRUB_CMDLINE_LINUX to include "net.ifnames=0 biosdevname=0". This is required for ethernet adapter to have predicatable name (eth0) instead of randomized junk like ens224 it's by default.

Tell grub to use new kernel parameters on next reboot:
grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)"

Fix network configuration script ifcfg-ens224 in /etc/sysconfig/network-scripts/
1. Change NAME=ens224 to NAME=eth0
2. Change DEVICE=ens224 to DEVICE=eth0
3. Generate new unique id with "uuidgen" and replace your old uuid value on UUID= line with it.

Save changes and rename ifcfg-ens224 to ifcfg-eth0.

Reboot.

That's it. Now systemd/NetworkDamager won't shutdown your ethernet interface once per hour.

Of course there's likely bunch of other bugs and corner cases in NetworkManager that may still kill your network. Therefore it's always recommended to disable it unless you really need some of NetworkManager specific features.

systemctl mask NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager

And reboot. Because rebooting is so much fun.

No comments:

Post a Comment

Got something to say?!