1# This file describes the network interfaces available on your system
2# and how to activate them. For more information, see interfaces(5).
3 4source /etc/network/interfaces.d/*
5 6# The loopback network interface
7auto lo
8iface lo inet loopback
910# The primary network interface
11allow-hotplug eth0
12iface eth0 inet dhcp
看到上面的最后一行没?这里需要将dhcp改为static,并配置指定的ip地址,具体如下:
1# This file describes the network interfaces available on your system
2# and how to activate them. For more information, see interfaces(5).
3 4source /etc/network/interfaces.d/*
5 6# The loopback network interface
7auto lo
8iface lo inet loopback
910# The primary network interface
11allow-hotplug eth0
12iface eth0 inet static
13 address 10.248.201.224/23
14 gateway 10.248.201.1
15 # dns-* options are implemented by the resolvconf package, if installed
16 dns-nameservers 10.248.201.8