ubantu16.4设置静态ip重启报错:[....] Restarting networking (via systemctl):。。。。

[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
 failed!

设置静态ip:vim /etc/network/interfaces

auto lo
iface lo inet loopback
auto enp3s0
iface enp3s0 inet static
address 192.168.0.162
netmask 255.255.255.0
gateway 192.168.0.1


dns-nameserver 192.168.0.1

然后重启 /etc/init.d/networking restart

报错:[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
 failed!

提示命令:systemctl status networking.service查看

 networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since 四 2019-08-29 15:42:17 CST; 1min 15s ago
     Docs: man:interfaces(5)
  Process: 13333 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCES
  Process: 13498 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 13494 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-
 Main PID: 13498 (code=exited, status=1/FAILURE)

8月 29 15:42:17 root2 systemd[1]: Starting Raise network interfaces...
8月 29 15:42:17 root2 ifup[13498]: RTNETLINK answers: File exists
8月 29 15:42:17 root2 ifup[13498]: Failed to bring up enp3s0.
8月 29 15:42:17 root2 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILUR
8月 29 15:42:17 root2 systemd[1]: Failed to start Raise network interfaces.
8月 29 15:42:17 root2 systemd[1]: networking.service: Unit entered failed state.
8月 29 15:42:17 root2 systemd[1]: networking.service: Failed with result 'exit-code'.

直接命令:ip addr flush dev enp3s0 && /etc/init.d/networking restart

ip addr flush dev ens33单独命令会断开远程连接

enp3s0是网卡名,根据自己的网卡更改名字

 

  • 6
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值