首页 > ubuntu server 修改/etc/network/interface后如何让修改生效?

ubuntu server 修改/etc/network/interface后如何让修改生效?

ubuntu server16.04,ditalocean上的vps,
我在修改了/etc/network/interface文件后,想让修改生效,于是/etc/init.d/networking restart,结果ssh连接就无响应了,我进Console发现已经无法连接外网,ping外网地址:

connect: network is unreachable

我又/etc/init.d/networking stop,再start,提示错误:

[....] 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.

之后可以ping通外网了,却仍无法start networking服务,
请问:修改/etc/network/interface后如何让修改生效? 如果是通过/etc/init.d/networking restart,为什么会出现以上的问题呢?


sudo ifdown interface_name && sudo ifup interface_name


sudo service network-manager restart


你的网络是不是被NetworkManager控制了

【热门文章】
【热门文章】