如何在Ubuntu18.04系统配置和修改IP
发布时间:2023-7-5 13:38:29 来源: 纵横云
如何在Ubuntu18.04系统配置和修改IP
在Ubuntu18.04系统中,如何修改IP配置?本文将针对此问题进行详细说明。Ubuntu 系统网卡配置文件在:/etc/network/interfaces
1.打开文件
sudo vi /etc/network/interfaces
可以看到以下内容

auto eth0 #设置开机自动启动eth0接口
iface eth0 inet static #配置静态IP
address 192.168.1.8 #IP地址
netmask 255.255.255.0 #子网掩码
gateway 192.168.1.1 #默认网关
修改后保存退出
2.重启网卡,使之配置生效
sudo /etc/init.d/networking restart
3.修改DNS
sudo vi /etc/resolv.conf
填入或修改以下内容:
nameserver 127.0.0.1 #必有
nameserver 1.1.1.1 #公共dns服务器
本文来源:
https://www.zonghengcloud.com/article/11445.html
[复制链接]
链接已复制