配置网络
Debian的网络配置文件在/etc/network/interfaces ,使用vi编辑器打开文件。
vi /etc/network/interfaces修改或追加下列内容。
auto eth0
iface eth0 inet static
address 172.16.2.35
netmask 255.255.0.0
gateway 172.16.0.2上述配置需要对应替换以下内容。
eth0要替换为自己网卡的名称(可以使用ip a查看)。172.16.2.35替换为想要设置的静态IP。255.255.0.0替换为对应的子网掩码。172.16.0.2替换为网关。
重启网络服务生效。
systemctl restart networking.service配置DNS服务器
Debian的DNS服务器配置和大部分Linux操作系统类似,也是修改/etc/resolve.conf 。
使用vi编辑器打开文件。
vi /etc/resolv.conf添加下列行。
nameserver 172.16.0.233上述配置需要对应替换以下内容。
172.16.0.233替换为需要的DNS服务器