There is an issue with CentOS 7 containers on OpenVZ nodes, where NetworkManager service breaks the network, and only localhost 127.0.0.1 network interface is coming up.
When you try to check network interfaces, and IP address on the server, you will only see localhost interface.
root@server [/]# ifconfig lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 9059 bytes 1539654 (1.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9059 bytes 1539654 (1.4 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
When issuing service network restart
you will and output like this:
Starting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. [FAILED]
When you run journalctl -xe
you will see errors like this:
-- Unit network.service has begun starting up. Feb 16 05:16:40 server network[2262]: Bringing up loopback interface: Could not load file '/etc/sysconfig/network-scripts/ifcfg-Feb 16 05:16:40 server network[2262]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' Feb 16 05:16:40 server network[2262]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' Feb 16 05:16:40 server network[2262]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' Feb 16 05:16:40 server network[2262]: [ OK ] Feb 16 05:16:40 server network[2262]: Bringing up interface venet0: Error: Connection activation failed: No suitable device founFeb 16 05:16:40 server network[2262]: [FAILED] Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server network[2262]: RTNETLINK answers: File exists Feb 16 05:16:40 server systemd[1]: network.service: control process exited, code=exited status=1 Feb 16 05:16:40 server systemd[1]: Failed to start LSB: Bring up/down networking. -- Subject: Unit network.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit network.service has failed. -- -- The result is failed. Feb 16 05:16:40 server systemd[1]: Unit network.service entered failed state. Feb 16 05:16:40 server systemd[1]: network.service failed. Feb 16 05:16:40 server polkitd[226]: Unregistered Authentication Agent for unix-process:2257:65393 (system bus name :1.37, object
Issue can be resolved by stopping and disabling the NetworkManager service.
root@server [/]# service NetworkManager stop Redirecting to /bin/systemctl stop NetworkManager.service root@server [/]# chkconfig NetworkManager off
You can also uninstall NetworkManager completely.
References:
https://lists.openvz.org/pipermail/users/2015-December/006691.html
Very useful, thanks man!