简体   繁体   English

无法ping docker IPv6容器

[英]Can't ping docker IPv6 container

I ran docker daemon for using it with global IPv6 for containers: 我运行了docker守护进程,将其与全局IPv6一起用于容器:

docker daemon --ipv6 --fixed-cidr-v6="xxxx:xxxx:xxxx:xxxx::/64"

After it I ran docker container: 之后,我运行了docker容器:

docker run -d --name my-container some-image

It successfully got Global IPv6 address( I checked by docker inspect my-container ). 它成功获取了全球IPv6地址(我通过docker inspect my-container )。 But I can't to ping my container by this ip: 但是我无法通过此ip ping我的容器:

Destination unreachable: Address unreachable

But I can successfully ping docker0 bridge by it's IPv6 address. 但是我可以通过它的IPv6地址成功ping docker0网桥。 Output of route -n -6 contains next lines: route -n -6输出包含以下几行:

    Destination                     Next Hop                   Flag Met Ref Use If
    xxxx:xxxx:xxxx:xxxx::/64         ::                         U    256 0     0 docker0
    xxxx:xxxx:xxxx:xxxx::/64         ::                         U    1024 0     0 docker0
    fe80::/64                        ::                         U    256 0     0 docker0

docker0 interface has global IPv6 address: docker0接口具有全局IPv6地址:

inet6 addr: xxxx:xxxx:xxxx:xxxx::1/64 Scope:Global

xxxx:xxxx:xxxx:xxxx:: everywhere is the same, and it's global IPv6 address of my eth0 interface xxxx:xxxx:xxxx:xxxx::到处都是一样的,这是我的eth0接口的全局IPv6地址

Does docker required something additional configs for accessing my containers via IPv6? docker是否需要其他配置才能通过IPv6访问我的容器?

Mb you use wrong ping command. MB您使用了错误的ping命令。 For ipv6 is ping6. 对于ipv6是ping6。

$ ping6 2607:f0d0:1002:51::4

Assuming IPv6 in your guest OS is properly configured probably you are pinging the container not from host OS, but outside and network discovery protocol is not configured. 假设来宾操作系统中的IPv6已正确配置,则可能不是从主机操作系统ping容器,而是未配置外部和网络发现协议。 Other hosts does not know if your container is behind of your host. 其他主机不知道您的容器是否在主机后面。 I'm doing this after start of container with IPv6 (in host OS) (in ExecStartPost clauses of Systemd .service file) 我在使用IPv6启动容器之后(在主机OS中)(在Systemd .service文件的ExecStartPost子句中)执行此操作

  1. /usr/sbin/sysctl net.ipv6.conf. / usr / sbin / sysctl net.ipv6.conf。 interface_name .proxy_ndp=1 interface_name .proxy_ndp = 1
  2. /usr/bin/ip -6 neigh add proxy $(docker inspect --format {{.NetworkSettings.GlobalIPv6Address}} container_name ) dev interface_name " / usr / bin / ip -6邻居添加代理$(docker inspect --format {{.NetworkSettings.GlobalIPv6Address}} container_name )dev interface_name

Beware of IPv6: docker developers say in replies to bug reports they do not have enough time to make IPv6 production-ready in version 1.10 and say nothing about 1.11. 提防IPv6:码头开发人员在对错误报告的答复中说,他们没有足够的时间使IPv6可以在1.10版中投入生产,而对1.11则一无所知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM