# 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
allow-hotplug eth0
iface eth0 inet dhcp
看到上面的最后一行没?这里需要将dhcp改为static,并配置指定的ip地址,具体如下:
# 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
allow-hotplug eth0
iface eth0 inet static
address 10.248.201.224/23
gateway 10.248.201.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.248.201.8
评论 (0)