我的物理服务器有两个接口:eth0 和 eth1。我打算在 ubuntu12.04 中启用这两个网络接口以用于互联网。我配置 /etc/network/interfaces 如下:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.10.101.105
gateway 10.10.101.254
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 10.10.101.205
gateway 10.10.101.254
netmask 255.255.255.0
ifconfig 的输出如下所示:
eth0 Link encap:Ethernet HWaddr e0:db:55:25:ed:10
inet addr:10.10.101.105 Bcast:10.10.101.255 Mask:255.255.255.0
inet6 addr: fe80::e2db:55ff:fe25:ed10/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1148531 errors:0 dropped:0 overruns:0 frame:0
TX packets:554215 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1636019748 (1.6 GB) TX bytes:40068201 (40.0 MB)
Interrupt:35
eth1 Link encap:Ethernet HWaddr e0:db:55:25:ed:11
inet addr:10.10.101.205 Bcast:10.10.101.255 Mask:255.255.255.0
inet6 addr: fe80::e2db:55ff:fe25:ed11/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:56699 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:4077879 (4.0 MB) TX bytes:492 (492.0 B)
Interrupt:38
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:124891 errors:0 dropped:0 overruns:0 frame:0
TX packets:124891 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1484482588 (1.4 GB) TX bytes:1484482588 (1.4 GB)
因此,我认为两个网络接口都已启动。但是,我发现我只能通过 eth0(10.10.101.105) 访问我的物理服务器,而无法通过 eth1(10.10.101.205) 访问它。
当我用来route -n
检查服务器中的路由器表时,它显示:
vli05@vli05:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.10.101.254 0.0.0.0 UG 100 0 0 eth0
10.10.101.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.101.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
我没发现任何问题。你能给我一些建议吗?谢谢。