vim /etc/dhcpcd.conf
# 指定接口 eth0
interface eth0
# 指定静态IP,/24表示子网掩码为 255.255.255.0
static ip_address=192.168.1.20/24
别修改/etc/network/interfaces
不行的话,把设置的固定ip注释掉,自动获取后,将固定ip改成那个自动获取的。再改下代码
23是255.255.254.0
vim /etc/dhcpcd.conf
# 指定接口 eth0
interface eth0
# 指定静态IP,/24表示子网掩码为 255.255.255.0
static ip_address=192.168.1.20/24
别修改/etc/network/interfaces
不行的话,把设置的固定ip注释掉,自动获取后,将固定ip改成那个自动获取的。再改下代码
23是255.255.254.0