IP地址以及网关修改、 修改文件
/etc/network/interfaces
sudo vim /etc/network/interfaces
对应作如下修改:
auto eth0 iface eth0 inet static ## 原来的内容为 iface eth0 inet dhcp address 192.168.0.117 gateway 192.168.0.1 #这个地址你要确认下 网关是不是这个地址 netmask 255.255.255.0 #network 192.168.0.0 #broadcast 192.168.0.255
DNS地址修改
sudo vim /etc/resolvconf/resolv.conf.d/base
在该文件中添加如下内容:
nameserver 223.5.5.5 nameserver 223.6.6.6
修改好保存,然后执行
sudo resolvconf -u
查看DNS地址改动【可选】
cat /etc/resolvconf/resolv.conf.d/head cat /etc/resolv.conf
重启网卡 或者 重启电脑
sudo /etc/init.d/networking restart ## 重启电脑 sudo reboot -h now
参考: https://blog.csdn.net/weixin_38090079/article/details/131703060
标签:LTS,network,sudo,192.168,Server,etc,conf,IP地址,eth0 From: https://www.cnblogs.com/open-coder/p/17720691.html