(1)修改/etc/network/interfaces:
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
auto enP4p65s0
iface enP4p65s0 inet static
address 192.168.0.123
netmask 255.255.255.0
gateway 192.168.0.1
nameserver 192.168.0.1
auto eth1
iface eth1 inet static
address 192.168.1.123
netmask 255.255.255.0
gateway 192.168.1.1
nameserver 192.168.1.1
(2)使设置的永久静态IP地址立即生效:
执行systemctl restart networking命令,执行完后,设备断电重启,此静态IP设置仍然生效。