请帮助配置 dom0 网络。dom0 主机是 Debian jessie。我需要配置 domu 以接受来自 OVH 中的 ip main(dom0)的不同子网。这是我的网络拓扑:
A.B.C.254 ---- A.B.C.81
(Gateway) (br0/dom0)
X.Y.X.150 ---- X.Y.X.144 - X.Y.Z.149 (domu)
(br1/dom0)
这是我的 dom0 /etc/network/interface:
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
bridge_ports eth0
address A.B.C.81
netmask 255.255.255.0
network A.B.C.0
broadcast A.B.C.255
gateway A.B.C.254
bridge_stp on
bridge_maxwait 0
pre-up /sbin/ipset restore < /etc/ipset.up.rules
pre-up /sbin/iptables-restore < /etc/iptables.up.rules
auto br1
iface br1 inet static
address X.Y.X.150
netmask 255.255.255.248
broadcast X.Y.X.151
pre-up brctl addbr br1
输出形式 route -v
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default A.B.C.254 0.0.0.0 UG 0 0 0 br0
A.B.C.0 * 255.255.255.0 U 0 0 0 br0
X.Y.X.144 * 255.255.255.248 U 0 0 0 br1
IP 路由的输出:
default via A.B.C.254 dev br0
A.B.C.0/24 dev br0 proto kernel scope link src A.B.C.81
X.Y.X.144/29 dev br1 proto kernel scope link src X.Y.X.150
brctl show 的输出
# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.e03f49e8149b yes eth0
br1 8000.feffffffffff no vif3.0
从 dom0,我可以 ping br1 和 br1,但不能 ping domu,并出现错误“您想 ping 广播吗?然后 -b”。只能使用 -b 选项
# ping X.Y.Z.144 -c 2 -b
WARNING: pinging broadcast address
PING X.Y.Z.144 (X.Y.Z.144) 56(84) bytes of data.
64 bytes from X.Y.Z.144: icmp_seq=1 ttl=64 time=0.163 ms
64 bytes from X.Y.Z.144: icmp_seq=2 ttl=64 time=0.127 ms
--- X.Y.Z.144 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.127/0.145/0.163/0.018 ms
从 domu,我可以 ping 通 br1 和 br0,但无法 ping 通互联网(8.8.8.8)从外部,我可以 ping 通 br0 和 br1,但无法 ping 通 domu。
真诚地感谢 Manu Purba
答案1
我将 domu ip 从 XYZ144 更改为 XYZ145。我无法使用 XYZ144 从外部进行网络 /29 ping:
>ping x.y.z.145
Pinging x.y.z.145 with 32 bytes of data:
Reply from x.y.z.145: bytes=32 time=276ms TTL=50
Reply from x.y.z.145: bytes=32 time=270ms TTL=50
Reply from x.y.z.145: bytes=32 time=288ms TTL=50
Reply from x.y.z.145: bytes=32 time=269ms TTL=50
Ping statistics for x.y.z.145:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 269ms, Maximum = 288ms, Average = 275ms