首页 > 编程知识 正文

重启网络服务失败,linux如何重启网络

时间:2023-05-05 05:59:34 阅读:51462 作者:3545

系统重新启动网络运行失败

[ root @ ceph0~ ] # systemctlrestartnetwork

jobfornetwork.servicefailedbecausethecontrolprocessexitedwitherrorcode.see ' systemctlstatusnetwork.service ' and ' jour

[ root @ ceph0~ ] # systemctlstatusnetwork

network.service-LSB : bring up/down networking

加载:加载(/etc/RC.d/init.d/network; bad; vendor preset :禁用)

活动:故障诊断(result :退出代码) since二2019-03-26 12:02:46 CST; 8s ago

docs : man :系统系统系统同步生成器(8)。

process 33603185106 execstart=/etc/RC.d/init.d/networkstart (代码=exited,status=1/FAILURE ) ) ) )

3月26日12336002336046 ceph 0net work [ 3185106 ] : rtnetlink answers : file exists

3月26日12336002336046 ceph 0net work [ 3185106 ] : rtnetlink answers : file exists

3月26日12336002336046 ceph 0net work [ 3185106 ] : rtnetlink answers : file exists

3月26日12336002336046 ceph 0net work [ 3185106 ] : rtnetlink answers : file exists

3月26日12336002336046 ceph 0net work [ 3185106 ] : rtnetlink answers : file exists

3月26日12336002336046 ceph 0net work [ 3185106 ] : rtnetlink answers : file exists

3月26日12:02336046 ceph0systemd [1] : network.service : controlprocessexited,code=exited status=1

3月26日12:02:46 ceph 0系统[1] : failedtostartlsb : bring up/down networking。

3月26日12:02336046 ceph0systemd [1] : unit network.serviceenteredfailedstate。

3月26日12:02336046 ceph 0系统[1] : network.service failed。

请看红色部门failedtostartlsb : bring up/down networking。 但是,实际上这个信息很少用于鸡蛋

我相信如果你不带着这个信息在网上搜索,你可能会失望而归。 cdn等博客都是你抄我,我抄你,从来没有验证过的是复制粘贴。

调查想法

遇到这样的问题,最好的办法就是看看日志输出了什么。 运行tail-f/var/log/messages

[根@ ceph0~ ] # tail-f/var/log/messages|grep network

mar 2612336005336006 ceph0systemd : starting LSB : bring up/down networking .

mar 2612336005336006 ceph 0net work : bringinguploopbackinterface : [ ok ]

mar 2612336005336006 ceph 0net work : bringingupinterfaceeth 0: [确定]

mar 2612336005336006 ceph 0net work : bringingupinterfaceeth 1: error : connectionactivationfailed : nosuitabledeviceviecefououre

mar 2612336005336006 ceph 0net work : [ failed ]

mar 2612336005336006 ceph 0net work : bringingupinterfaceeth 2: error : connectionactivationfailed : nosuitabledeviceviecefououre

mar 2612336005336006 ceph 0net work : [ failed ]

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612336005336006 ceph 0net work : rtnetlink answers : file exists

mar 2612:05336006 ceph0systemd : network.service : controlprocessexited,code=exited status=1

mar 2612336005336006 ceph0systemd : failedtostartlsb : bring up/down networking。

mar 2612336005336006 ceph0systemd : unit network.serviceenteredfailedstate。

mar 2612336005336006 ceph0systemd : network.service failed。

出现误报

mar 2612336005336006 ceph 0net work : bringingupinterfaceeth 1: error : connectionactivationfailed : nosuitabledeviceviecefououre

mar 2612336005336006 ceph 0net work : [ failed ]

mar 2612336005336006 ceph 0net work : bringingupinterfaceeth 2: error : connectionactivationfailed : nosuitabledeviceviecefououre

很明显,如果没有eth1和eth2连接器,将出现错误,/etc/sys config/network-scripts /

[根@ ceph0~ ] # CD/etc/sys config/network-scripts /

[root@ceph0 network-scripts]# ls

if CFG-eth0ifdown-eth ifdown-post ifdown-tunnel ifup-ipppifup-post ifup-tunnel

if CFG-et h1 ifdown-IB ifdown-pppifupifup-IPv6 ifup-PPP ifup -无线

if CFG-eth2ifdown-ipppifdown-routes ifup-aliases ifup-isdn ifup-routes init.IPv6-global

if CFG-lo ifdown-IPv6 ifdown-sit ifup-bnep ifup-ovs ifup-sit网络-功能

ifdown ifdown-isdn ifdown-team ifup-eth ifup-plip ifup-team网络- functions-IPv6

ifdown-bnep ifdown-ovs ifdown-teamportifup-IB ifup-plusbifup-team port

[ root @ ceph 0网络脚本] #

删除eth1和eth2配置文件,然后重新启动网卡即可

root @ ceph 0net work-scripts ] # RM-rfifcfg-et h1 if CFG-eth 2

[ root @ ceph 0net work-scripts ] # systemctlrestartnetwork

[ root @ ceph 0网络脚本] #

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。