我在ubuntu机器上配置了多个IP地址,但运行ifconfig
时只显示其中一个。但是,我能够ping通分配给这台机器的所有其他地址。
/etc/network/interface
内容:
# 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
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.202.11
netmask 255.255.255.0
network 192.168.202.0
broadcast 192.168.202.255
gateway 192.168.202.1
# dns-* options are implemented by the resolvconf package, if installed
dns-search idil.dz1.da
auto eth0:1
iface eth0:1 inet static
address 192.168.202.12
netmask 255.255.255.0
auto eth0:2
iface eth0:2 inet static
address 192.168.202.13
netmask 255.255.255.0
auto eth0:3
iface eth0:3 inet static
address 192.168.202.14
netmask 255.255.255.0
auto eth0:4
iface eth0:4 inet static
address 192.168.202.15
netmask 255.255.255.0
auto eth0:5
iface eth0:5 inet static
address 192.168.202.16
netmask 255.255.255.0
但是,的输出ifconfig
仅为:
192.168.202.11
ip addr show
作品