大佬们,我按网上搜的教程设置静态ip后如果不是默认的那个ip都没办法连接ssh,而且默认的那个ip更换路由器后也无法连接,不知道是哪的问题,求大佬们帮帮忙。
/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
iface lo inet loopback
# The primary network interface
auto enp2s0
allow-hotplug enp2s0
iface enp2s0 inet static
address 192 .168 .31.100
netmask 255.255.255 .0
gateway 192.168.31.1
/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
iface lo inet loopback
# The primary network interface
auto enp2s0
allow-hotplug enp2s0
iface enp2s0 inet static
address 192 .168 .31.100
netmask 255.255.255 .0
gateway 192.168.31.1