Ubuntu 上的多个界面

Ubuntu 上的多个界面

我的 Ubuntu 机器(Ubuntu 12.04.1 LTS)上有多个接口,每个接口都分配了来自同一子网的 IP。

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:56:9f:0a:0c
          inet addr:10.28.49.89  Bcast:10.28.49.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9f:a0c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:54350 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11811 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:67368828 (67.3 MB)  TX bytes:1210132 (1.2 MB)

eth1      Link encap:Ethernet  HWaddr 00:50:56:9f:82:ae
          inet addr:10.28.49.97  Bcast:10.28.49.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9f:82ae/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6657 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2967245 (2.9 MB)  TX bytes:468 (468.0 B)

eth2      Link encap:Ethernet  HWaddr 00:50:56:9f:52:9b
          inet addr:10.28.49.98  Bcast:10.28.49.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9f:529b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6644 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2963870 (2.9 MB)  TX bytes:468 (468.0 B)

eth3      Link encap:Ethernet  HWaddr 00:50:56:9f:2c:a9
          inet addr:10.28.49.100  Bcast:10.28.49.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9f:2ca9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6626 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2954844 (2.9 MB)  TX bytes:936 (936.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5487 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5487 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:510360 (510.3 KB)  TX bytes:510360 (510.3 KB)

网络上只有 eth0 和 eth3 接口可 ping 通。

下面给出了 /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
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 10.28.49.89
        netmask 255.255.255.0
        network 10.28.49.0
        broadcast 10.28.49.255
        gateway 10.28.49.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 72.163.128.140
        dns-search abc.com
auto eth1
iface eth1 inet static
        address 10.28.49.97
        netmask 255.255.255.0
        network 10.28.49.0
        broadcast 10.28.49.255
auto eth2
iface eth2 inet static
        address 10.28.49.98
        netmask 255.255.255.0
        network 10.28.49.0
        broadcast 10.28.49.255
auto eth3
iface eth3 inet static
        address 10.28.49.100
        netmask 255.255.255.0
        network 10.28.49.0
        broadcast 10.28.49.255

路线:

# ip route show
default via 10.28.49.1 dev eth0  metric 100
10.28.49.0/24 dev eth0  proto kernel  scope link  src 10.28.49.89
10.28.49.0/24 dev eth1  proto kernel  scope link  src 10.28.49.97
10.28.49.0/24 dev eth2  proto kernel  scope link  src 10.28.49.98
10.28.49.0/24 dev eth3  proto kernel  scope link  src 10.28.49.100

更远:

# ping -I eth0 10.28.49.97
PING 10.28.49.97 (10.28.49.97) from 10.28.49.89 eth0: 56(84) bytes of data.
^C
--- 10.28.49.97 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms

# ping -I eth0 10.28.49.98
PING 10.28.49.98 (10.28.49.98) from 10.28.49.89 eth0: 56(84) bytes of data.
^C
--- 10.28.49.98 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms

我的问题是:

  1. 为什么网络上无法 ping 通接口 eth1 和 eth2?
  2. 为什么如上图所示,这些接口无法从其他接口访问?

谢谢!

相关内容