设置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

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐