我有一个带有两个接口的 Ubuntu 16.04 系统 - eth0 配置了 DHCP,eth1 配置了静态 IP 地址。
/etc/network/interfaces 文件有以下配置
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# The Secondary network interface
auto eth1
iface eth1 inet static
address 10.10.1.10
netmask 255.255.255.0
dns-nameservers 74.82.42.42 4.2.2.2
## Virtual Interfaces for virtual hosts
auto eth1:11
iface eth1:11 inet static
address 10.10.1.11
netmask 255.255.255.0
auto eth1:12
iface eth1:12 inet static
address 10.10.1.12
netmask 255.255.255.0
auto …Run Code Online (Sandbox Code Playgroud)