重启机器后,发现ping不通baidu,重启网卡异常报错:Failed to start LSB: Bring up/down networking
解决方案:
1.禁用NetworkManager
#关闭NetworkManager服务
[root@localhost ~]# systemctl stop NetworkManager
#永久关闭NetworkManager服务
[root@localhost ~]# systemctl disable NetworkManager
2.关闭防火墙
[root@localhost ~]# systemctl stop firewalld
#禁用
[root@localhost ~]# systemctl disable firewalld
3.关闭selinux
#查看selinux状态
[root@localhost ~]# getenforce
Enforcing ---开启
# 临时关闭
[root@localhost ~]# setenforce 0
# 修改selinux配置文件,永久关闭selinux,重启后生效.
[root@localhost ~]# vim /etc/selinux/config
...
SELINUX=disabled
...
4.重启
[root@localhost ~]# reboot
5.重启网卡验证
[root@localhost ~]# systemctl restart network
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.166.0.128 netmask 255.255.192.0 broadcast 192.166.63.255
inet6 fe80::20c:29ff:fe14:b6ca prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:14:b6:ca txqueuelen 1000 (Ethernet)
RX packets 16908 bytes 1059845 (1.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 582 bytes 58830 (57.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1 (Local Loopback)
RX packets 32 bytes 2190 (2.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32 bytes 2190 (2.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:7d:d4:d5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ping baidu.com
PING baidu.com (39.156.66.10) 56(84) bytes of data.
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=1 ttl=48 time=9.37 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=2 ttl=48 time=10.6 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=3 ttl=48 time=10.1 ms
^C
--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 9.370/10.063/10.688/0.540 ms
[root@localhost ~]#