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

查看:1491
本文介绍了linux - 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,为什么会出现以上的问题呢?

解决方案

我也遇到过这个问题,只要在interfaces文件中添加一条mac地址(硬件地址,就是我画黄色的部分)的设置,然后再重启电脑,就可以重启网卡了

这篇关于linux - ubuntu server 修改/etc/network/interface后如何让修改生效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆