Debian 10.1 配置固定ip和DNS

一、设置固定ip

修改/etc/network/interfaces,加入: auto eth0 iface eth0 inet static address 192.168.0.3 netmask 255.255.255.0 gateway 192.168.0.1

二、设置DNS

修改/etc/resolv.conf,加入: nameserver 192.168.0.1 nameserver 192.168.0.2

三、重启网络服务使生效

执行命令即可:/etc/init.d/networking restart

Last updated