本文共 2100 字,大约阅读时间需要 7 分钟。
前期帮用户架设了一台虚拟机,相关网络配置正常后,用户安装好所有应用程序 ,重启后突然发现网络不能正常连接,但开机前几秒钟可正常,后续持续故障,
service network restart 后能正常几秒钟故障依旧。
(1)linux下关闭安全狗 (问题没有解决)
使用:
service safedog statusservice safedog startservice safedog stop查看、启动或停止服务,问题依然没有解决。(2)重新配置网络设置 (问题没有解决)
Centos 网络设置
这里首先是进入/etc/sysconfig/network-scripts中查看现有的配置文件:
通过ls查看文件看到该文件目录下的文件:
TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noNAME=eno16777736UUID=ae05ccde-6a29-4332-b486-f3042da73ac0DEVICE=eno16777736ONBOOT=no这里说一下需要修改的位置:#修改
BOOTPROTO=static #这里讲dhcp换成ststicONBOOT=yes #将no换成yes#新增IPADDR=192.168.85.100 #静态IPGATEWAY=192.168.85.2 #默认网关NETMASK=255.255.255.0 #子网掩码保存退出后,重启网络服务:Restarting network (via systemctl): [ 确定 ]
查看当前ip:1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:e7:b8:77 brd ff:ff:ff:ff:ff:ffinet 192.168.85.100/24 brd 192.168.85.255 scope global eno16777736valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fee7:b877/64 scope link valid_lft forever preferred_lft forever3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN link/ether 52:54:00:b9:8f:6c brd ff:ff:ff:ff:ff:ffinet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 500link/ether 52:54:00:b9:8f:6c brd ff:ff:ff:ff:ff:ff(3)解决办法 :关闭NetworkManager服务 正常。
运行下列命令:
chkconfig network offchkconfig network onservice NetworkManager stop (注意大小写)service NetworkManager start (注意大小写)这命令的意思是:重新运行网络管理装置转载于:https://blog.51cto.com/onroad/2377077