[转] Ubuntu Server V13.x 支持多IP,主网卡自动 DHCP,且该网卡带多个静态配置的附属IP地址 (“/etc/network/interfaces”)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
#iface eth0 inet static
#address 192.168.8.251
#netmask 255.255.255.0
#gateway 192.168.8.253
auto eth0:0
iface eth0:0 inet static
address 192.168.0.251
netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet static
address 192.168.1.251
netmask 255.255.255.0
auto eth0:2
iface eth0:2 inet static
address 192.168.8.251
netmask 255.255.255.0
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
#iface eth0 inet static
#address 192.168.8.251
#netmask 255.255.255.0
#gateway 192.168.8.253
auto eth0:0
iface eth0:0 inet static
address 192.168.0.251
netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet static
address 192.168.1.251
netmask 255.255.255.0
auto eth0:2
iface eth0:2 inet static
address 192.168.8.251
netmask 255.255.255.0
本文介绍如何在Ubuntu Server V13.x中配置主网卡通过DHCP自动获取IP,并同时为该网卡设置多个静态IP地址。具体实现方式是在“/etc/network/interfaces”文件中定义多个附属IP地址。
3338

被折叠的 条评论
为什么被折叠?



