两个网络无法同时访问

两个网络无法同时访问

我在服务器上有两个网络。一个是我的内部网络,另一个是外部 IP 地址。这是在 Debian Lenny 上。这是我的 /etc/network/interfaces 文件:

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
        address 24.249.108.xxx
        netmask 255.255.255.224
        broadcast 24.249.108.255
        gateway 24.249.108.193

我可以重新启动系统,有时 eth1 可以通过 SSH 访问,有时 eth0 可以访问。然后有时 eth1 会完全无法 ping 通。这是 Debian 的一个相当新安装,我唯一运行的是 VMWare Server 2.0,它桥接到我的两个网络连接。

我的路线如下:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
24.249.108.192  *               255.255.255.224 U     0      0        0 eth1
172.16.130.0    *               255.255.255.0   U     0      0        0 eth0
default         wsip-24-249-108 0.0.0.0         UG    0      0        0 eth1
default         plumbco-router. 0.0.0.0         UG    0      0        0 eth0

答案1

这里的问题是您有两个默认网关。

除非您使用特殊路由协议(BGP,OSPF等),否则您只能有一个网关。

您必须通过非默认接口设置到其他特定网络的静态路由。

默认网关应该是连接到大多数其他网络的网关(通常是互联网连接,我认为是 eth1)。

另外,顺便提一下,eth0 的广播地址是错误的 - 它应该是 ..130.. 而不是 ..120..

相关内容