一、Xshell掉了,重新连接失败。先ping一下,看网络是否通的

尝试失败,ping www.baidu.com

二、重启network服务,发现报错

systemctl restart network

service network restart

Restarting 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.

三、根据提示查看报错信息

[root@zy ~]# systemctl status network.service
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since 四 2021-06-03 05:23:42 CST; 23s ago
Docs: man:systemd-sysv-generator(8)
Process: 8821 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 systemd[1]: network.service: control process exited, code=e...s=1
6月 03 05:23:42 db01 systemd[1]: Failed to start LSB: Bring up/down networking.
6月 03 05:23:42 db01 systemd[1]: Unit network.service entered failed state.
6月 03 05:23:42 db01 systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

四、解决方法

1.先看配置文件 vim /etc/sysconfig/network-scripts/ifcfg-ens33

2.可能与NetworkManager服务有冲突,直接关闭该服务即可

[root@db01 ~]# systemctl stop NetworkManager
[root@db01 ~]# systemctl restart network

3.若1、2两种方法查验后仍然不行,可尝试将/etc/sysconfig/network-scripts下,将其余无关的网卡位置文件全删掉,避免不必要的影响

[root@db01 network-scripts]# ls
ifcfg-ens33 ifdown-ipv6 ifdown-tunnel ifup-isdn ifup-TeamPort
ifcfg-ens33.bak ifdown-isdn ifup ifup-plip ifup-tunnel
ifcfg-lo ifdown-post ifup-aliases ifup-plusb ifup-wireless
ifdown ifdown-ppp ifup-bnep ifup-post init.ipv6-global
ifdown-bnep ifdown-routes ifup-eth ifup-ppp network-functions
ifdown-eth ifdown-sit ifup-ib ifup-routes network-functions-ipv6
ifdown-ib ifdown-Team ifup-ippp ifup-sit
ifdown-ippp ifdown-TeamPort ifup-ipv6 ifup-Team

五、验证网络

ping www.baidu.com