Debian 9 stretch查看IP的命令已变更,之前使用ifconfig不能用了,需要使用:ip address

如下图:并且网卡的名字也不一样了

Debian 9 stretch设置静态IP方法如下

输入:nano /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
# auto lo
auto ens192
# iface lo inet loopback

# The primary network interface
allow-hotplug ens192
# iface ens192 inet dhcp
iface ens192 inet static
address 192.168.0.3
netmask 255.255.255.0
gateway 192.168.0.1

记得把ens192的网卡名,改为自己的

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注