Docker Container to Container仅与IPv6通信

时间:2016-12-09 09:27:32

标签: docker ipv6

我在OpenStack Mirantis上运行两个VM。对于Simplicity,我们称之为host-1和host-2。我无法通过 Container与不同主机上的Container进行通信而不是 Container to Public Internet 在每台主机上我已经安装了Docker ver 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

所有输出相同i,e -

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路由都是相同的,e -

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 route都是相同的,e -

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转发都是相同的,e -

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

两个容器ip转发都是相同的,e -

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

0 个答案:

没有答案