设置ip

/etc/network/interfaces

改为如下

auto eth0
iface eth0 inet static
address 192.168.0.190
gateway 192.168.0.1
netmask 255.255.255.0

address:IP地址
gateway:网关
netmask:子网掩码
auto eth0:开机自启
iface eth0 inet static: 静态ip

设置dns

/etc/resolv.conf

改为如下

nameserver 223.5.5.5
nameserver 192.168.0.1

重启并应用

systemctl restart networking
Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐