OpenVZゲストにCentOS7を使うとなぜかIPが活性化しない。
ip コマンドでもだめ
ip addr add 192.168.1.4/24 dev venet0
ip route add default via 192.168.1.1
IPは付与されるが他と通信できない。
systemctl restart network してもダメ
# systemctl status network
network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network)
Active: failed (Result: exit-code) since 金 2015-05-29 13:30:03 JST; 18s ago
Process: 1028 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
5月 29 13:30:03 c7.vz network[1028]: RTNETLINK answers: File exists
5月 29 13:30:03 c7.vz network[1028]: RTNETLINK answers: File exists
5月 29 13:30:03 c7.vz network[1028]: RTNETLINK answers: File exists
5月 29 13:30:03 c7.vz network[1028]: RTNETLINK answers: File exists
5月 29 13:30:03 c7.vz network[1028]: RTNETLINK answers: File exists
5月 29 13:30:03 c7.vz systemd-sysctl[1179]: Failed to write '16' to '/proc/sys/kernel/sysrq': Permission denied
5月 29 13:30:03 c7.vz systemd-sysctl[1179]: Failed to write '1' to '/proc/sys/kernel/core_uses_pid': Permission denied
5月 29 13:30:03 c7.vz systemd[1]: network.service: control process exited, code=exited status=1
5月 29 13:30:03 c7.vz systemd[1]: Failed to start LSB: Bring up/down networking.
5月 29 13:30:03 c7.vz systemd[1]: Unit network.service entered failed state.
# /etc/init.d/network restart
Restarting network (via systemctl): Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.
[失敗]
調査
# ifup venet0
エラー: 接続 'System venet0'用のデバイスが見つかりません.
# LANG=C ifup venet0
Error: no device found for connection 'System venet0'.
ググると出てきた。
NetworkManagerが原因
# service NetworkManager stop
# chkconfig NetworkManager off
# /etc/init.d/network restart
Restarting network (via systemctl): [ OK ]
外部と通信できるようになった。