我已经配置了两个虚拟机并将它们分配给 eth0 和 eth1 接口。但是,我遇到了连接问题,因为我无法使用 eth1 在两个虚拟机之间进行 ping 操作。我已验证 eth1 的网络配置正确,并且使用 eth0 时虚拟机可以成功通信。
两个虚拟机上的防火墙均已禁用。
虚拟机1:
# ip addr show
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:16:3e:00:00:01 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:16:3e:00:00:02 brd ff:ff:ff:ff:ff:ff
inet 172.16.1.100/24 brd 172.16.1.255 scope global eth1
valid_lft forever preferred_lft forever
# ip route show
default via 192.168.0.7 dev eth0
172.16.1.0/24 dev eth1 proto kernel scope link src 172.16.1.100
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1
192.168.0.3 via 192.168.0.7 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.2
# ping 172.16.1.1
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
路由器_vm1:
# ip addr show
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:16:3e:00:00:07 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.7/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:16:3e:00:00:08 brd ff:ff:ff:ff:ff:ff
inet 172.16.1.1/24 brd 172.16.1.255 scope global eth1
valid_lft forever preferred_lft forever
# ip route show
default via 192.168.0.254 dev eth0
172.16.1.0/24 via 172.16.1.1 dev eth1
172.16.1.0/24 dev eth1 proto kernel scope link src 172.16.1.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.7
192.168.0.1 via 192.168.0.7 dev eth0
# ping 172.16.1.100
PING 172.16.1.100 (172.16.1.100): 56 data bytes
我需要帮助来找到解决方案,以在 eth1 上的两个虚拟机之间实现正确的网络通信。