1

我有 3 个服务器,分别称为 Server-A、Server-B、Server-C

这是 IP:(例如)
Server-A (100.0.0.18/29)
Server-B (100.0.0.21/29)
Server-C (100.0.0.22/29)

在 Server-A (100.0.0.18/29) 中,我有两个 VM,分别称为 VM-1、VM-2

这是 IP:
VM-1 (100.0.0.19/29)
VM-2 (192.168.1.2/24)

我的问题是:
1. VM-1 和VM-2 可以上网,但有时VM-1 超时。
2. VM-1 无法ping 通Server-B 或Server-C,反之亦然。

这是/etc/network/interfaces配置:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 100.0.0.18
        netmask 255.255.255.248
        gateway 100.0.0.17
        post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

iface eth1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

auto vmbr1
iface vmbr1 inet static
        address 100.0.0.18
        netmask 255.255.255.248
        bridge_ports none
        bridge_stp off
        bridge_fd 0

        up ip route add 100.0.0.19/32 dev vmbr1

如何使 VM-1 能够从 Server-B 和 Server-C ping 通,反之亦然?

4

0 回答 0