故障现象:
1.服务器无法被ping通
2.GUI界面右上角看不到网卡图标
正常情况GUI显示的网络图标:
故障时网络图标消失后的样子:
3.ip addr网卡没有地址
[root@xiamingliang ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:0c:29:c1:69:35 brd ff:ff:ff:ff:ff:ff
altname enp3s0
3: br-1c57ae1d2940: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:3a:6b:40:d9 brd ff:ff:ff:ff:ff:ff
inet 172.20.0.1/16 brd 172.20.255.255 scope global br-1c57ae1d2940
valid_lft forever preferred_lft forever
……
3.nmcli device status状态为unmanaged
[root@xiamingliang ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
br-1c57ae1d2940 bridge unmanaged --
br-37a032e957ba bridge unmanaged --
br-b365648bec89 bridge unmanaged --
docker0 bridge unmanaged --
ens160 ethernet unmanaged --
veth5707956 ethernet unmanaged --
vethfce698f ethernet unmanaged --
lo loopback unmanaged --
[root@OpenKM ~]#
4.nmcli connection show状态为unmanaged
[root@xiamingliang ~]# nmcli connection show
NAME UUID TYPE DEVICE
ens160 cf32e4bc-eaf9-3db0-98bb-2879bd5153d8 ethernet --
[root@xiamingliang ~]#
5.尝试修复,出现device is strictly unmanaged报错
[root@xiamingliang ~]# nmcli connection up ens160
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
[root@xiamingliang ~]#
[root@OpenKM ~]# nmcli device up ens160
Error: Failed to add/activate new connection: Connection 'ens160' is not available on device ens160 because device is strictly unmanaged
[root@xiamingliang ~]#
[root@xiamingliang ~]# nmcli device set ens160 managed yes
[root@xiamingliang ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
br-1c57ae1d2940 bridge unmanaged --
br-37a032e957ba bridge unmanaged --
br-b365648bec89 bridge unmanaged --
docker0 bridge unmanaged --
ens160 ethernet unmanaged --
veth1ea0122 ethernet unmanaged --
veth5707956 ethernet unmanaged --
lo loopback unmanaged --
[root@OpenKM ~]#
尝试restart和reload NetworkManager.service均无效
[root@xiamingliang ~]# systemctl reload NetworkManager.service
[root@xiamingliang ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
br-1c57ae1d2940 bridge unmanaged --
br-37a032e957ba bridge unmanaged --
br-b365648bec89 bridge unmanaged --
docker0 bridge unmanaged --
ens160 ethernet unmanaged --
veth5707956 ethernet unmanaged --
veth6817ed8 ethernet unmanaged --
lo loopback unmanaged --
[root@xiamingliang ~]#
解决办法:
我的环境解决办法是:
//确定NetworkManager是否已接管了系统的网络连接管理
[root@xiamingliang ~]# nmcli networking
disabled
[root@xiamingliang ~]#
//若没有解决则需要手动开启接管
[root@xiamingliang ~]# nmcli networking on
[root@xiamingliang ~]#
//接管后恢复正常
[root@xiamingliang ~]# nmcli connection show
NAME UUID TYPE DEVICE
ens160 cf32e4bc-eaf9-3db0-98bb-2879bd5153d8 ethernet ens160
[root@xiamingliang ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
ens160 ethernet connected ens160
docker0 bridge connected (externally) docker0
br-1c57ae1d2940 bridge disconnected --
br-37a032e957ba bridge disconnected --
br-b365648bec89 bridge disconnected --
veth5707956 ethernet unmanaged --
veth6df1eb1 ethernet unmanaged --
lo loopback unmanaged --
[root@xiamingliang ~]#
可能的其他解决方法:
或者也可以修改NetworkManager.service配置文件后再重启服务解决;配置文件路径是:/var/lib/NetworkManager/NetworkManager.state
[root@xiamingliang ~]# cat /var/lib/NetworkManager/NetworkManager.state
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
[root@xiamingliang ~]#
注意:操作顺序先stop服务,再修改配置文件;最后启动服务。
[root@xiamingliang ~]# systemctl stop NetworkManager
[root@xiamingliang ~]# vi /var/lib/NetworkManager/NetworkManager.state
[root@xiamingliang ~]# cat /var/lib/NetworkManager/NetworkManager.state
[main]
NetworkingEnabled=true //修改为true
WirelessEnabled=true
WWANEnabled=true
[root@xiamingliang ~]# systemctl start NetworkManager
[root@xiamingliang ~]#
故障原因:
未知系统原因导致NetworkManager没有正确接管系统的网络连接管理;其实,没有调整过NetworkManager配置的情况下重启服务器也是可以解决的,但是极端情况下要避免服务器的重启操作,这个方法会很有效。
本文一来分享一些技术问题的解决方法;二来也作为自己的经历记录;希望可以帮到更多有需要的人。
标签:bridge,Network,Centos,--,xiamingliang,网卡,NetworkManager,unmanaged,root From: https://blog.51cto.com/mlxia/5765714