Linux、Ubuntu,单网卡多IP地址配置
sudo vi /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
auto eth0:0
iface eth0:0 inet static
address 192.168.1.253
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
auto eth0:1
iface eth0:1 inet static
address 192.168.200.253
netmask 255.255.255.0
#gateway 192.168.200.1 默认网关只能有一个, Only one gateway allowed!
dns-nameservers 208.67.222.222 8.8.8.8
auto usb0
iface usb0 inet static
address 192.168.2.2
netmask 255.255.255.0
dns-nameservers 208.67.222.222 8.8.8.8
ifup eth0:0
ifup eth0:1
....