我知道我无法从同一主机ping通macvlan接口,但是我无法从其他子网中的主机ping通容器的macvlan接口(即使它们通过路由器连接)。
主机IP:10.8.2.132/22
Macvlan容器IP:10.8.2.250/22
其他主机IP:10.4.16.141/22
Ping FROM 10.8.2.132 TO 10.4.16.141 is successful
Ping FROM 10.8.2.250 TO 10.4.16.141 is successful
Ping FROM 10.4.16.141 TO 10.8.2.132 is successful
Ping FROM 10.4.16.141 TO 10.8.2.250 fails with 100% packet loss
ip route get 10.8.2.250显示存在一条已知路由:
10.8.2.250 via 10.4.16.1 dev eth0 src 10.4.16.141
cache mtu 1500 hoplimit 64
我该如何调试呢?
docker macvlan网络是通过以下方式创建的:
docker network create -d macvlan --subnet=10.8.0.0/22 --gateway=10.8.0.1 -o parent=em1 macnet
当我运行容器时,我会特别添加“ --ip = 10.8.2.250”