Docker容器到容器只与IPv6通信

我在OpenStack Mirantis上运行两个虚拟机。 为了简单,让我们调用host-1和host-2。 我无法在不同的主机上容器到容器进行通信,而不是从容器到 公共互联网在每个主机上,我已经安装了Docker版本1.12.3,并运行以下内容 –

tee Dockerfile <<-'EOF' FROM centos RUN yum -y install net-tools bind-utils iputils* EOF 

之后 –

 docker build -t crazy:3 . 

在主机1上: –

 dockerd --ipv6 --fixed-cidr-v6="2001:1b76:2400:e2::2/64" & run -i -t --entrypoint /bin/bash crazy:3 ping6 -c3 google.com ifconfig 

在主机2上: –

 dockerd --ipv6 --fixed-cidr-v6="2001:1b76:2400:e2::2/64" & run -i -t --entrypoint /bin/bash crazy:3 ping6 -c3 google.com ifconfig 

主机1输出: –

 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.2 netmask 255.255.0.0 broadcast 0.0.0.0 inet6 2001:1b76:2400:e2:0:242:ac11:2 prefixlen 64 scopeid 0x0<global> inet6 fe80::42:acff:fe11:2 prefixlen 64 scopeid 0x20<link> ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 18 bytes 1663 (1.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 53 bytes 4604 (4.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

主机2输出: –

 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.2 netmask 255.255.0.0 broadcast 0.0.0.0 inet6 2001:1b76:2400:e2:0:242:ac11:3 prefixlen 64 scopeid 0x0<global> inet6 fe80::42:acff:fe11:2 prefixlen 64 scopeid 0x20<link> ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 8 bytes 808 (808.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 508 (508.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

然后再次

 On host-1:-- ping6 2001:1b76:2400:e2:0:242:ac11:3 On host-2:-- ping6 2001:1b76:2400:e2:0:242:ac11:2 

所有的输出都是相同的,

 PING 2001:1b76:2400:e2:0:242:ac11:3(2001:1b76:2400:e2:0:242:ac11:3) 56 data bytes From 2001:1b76:2400:e2:0:242:ac11:2 icmp_seq=1 Destination unreachable: Address unreachable From 2001:1b76:2400:e2:0:242:ac11:2 icmp_seq=2 Destination unreachable: Address unreachable From 2001:1b76:2400:e2:0:242:ac11:2 icmp_seq=3 Destination unreachable: Address unreachable From 2001:1b76:2400:e2:0:242:ac11:2 icmp_seq=4 Destination unreachable: Address unreachable 

两个主机的IP路由是一样的我,

 2001:1b76:2400:e2:f816:3eff:fe69:c2f2 dev eth0 metric 0 cache 2001:1b76:2400:e2::/64 dev eth0 proto kernel metric 256 expires 28133sec 2001:1b76:2400:e2::/64 dev docker0 proto kernel metric 256 2001:1b76:2400:e2::/64 dev docker0 metric 1024 fe80::/64 dev eth0 proto kernel metric 256 fe80::/64 dev docker0 proto kernel metric 256 

这两个容器的IP路由是一样的我,

 2001:1b76:2400:e2::1 dev eth0 metric 0 cache 2001:1b76:2400:e2::/64 dev eth0 proto kernel metric 256 fe80::/64 dev eth0 proto kernel metric 256 default via 2001:1b76:2400:e2::1 dev eth0 metric 1024 

这两个主机的IP转发是一样的我,

 net.ipv4.conf.all.forwarding = 1 net.ipv6.conf.all.forwarding = 1 

这两个容器的IP转发是一样的我,

 net.ipv4.conf.all.forwarding = 1 net.ipv6.conf.all.forwarding = 0