Ubuntu服务器14.04上的两个networking适配器不稳定的连接

我在我的服务器上遇到一个奇怪的行为。 它是一个虚拟机,在ESXi上运行,它位于OVH的“所以你启动服务器”上。 我希望虚拟机具有两个networking适配器:一个连接到内部LAN,另一个使用OVH IP故障转移系统连接到互联网(外部)。

当两个接口同时运行时,服务器与互联网的连接在WAN和LAN上是不稳定的。 有时可以ping通外部(google.com),而下一分钟则不能。

这里是/ 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.110.110.199 netmask 255.255.255.0 network 10.110.110.0 broadcast 10.110.110.255 gateway 10.110.110.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 dns-search qwerteach.com auto eth1 iface eth1 inet static address my.wan.ip.xxx netmask 255.255.255.255 broadcast my.wan.ip.xxx dns-nameservers 8.8.8.8 post-up route add ovh.gw.xxx.xxx dev eth1 post-up route add default gw ovh.gw.xxx.xxx dev eth1 pre-down route del ovh.gw.xxx.xxx dev eth1 pre-down route del default gw ovh.gw.xxx.xxx dev eth1 up route add -net 10.110.112.0 netmask 255.255.255.0 gw 10.110.110.254 

其中ovh.gw.xxx.xxx是ovh要求使用ip故障切换的自定义网关(如此处所述)

任何见解? 提前致谢!

你的netmask是错误的。 虽然,这不是你的错, OVH指南也是错误的。 netmask应该设置为255.255.255.0并且不应该存在post-up route addpre-down route del行。