A
A
alexmsk2021-06-06 17:49:17
Computer networks
alexmsk, 2021-06-06 17:49:17

How to make a Docker container accessible via ipv6?

Can't make Docker container accessible via ipv6.

What did:
1. Set up ipv6 on the server. (there is only one address). Checked. This server is pinged via ipv6 and is available via ssh.

2. Added ipv6 support to Docker

[email protected]:~# cat /etc/docker/daemon.json 
{
  "ipv6": true,
  "fixed-cidr-v6": "fd12:3456:789a:1::/64"
}

3. Made changes to sysctl:
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.eth0.accept_ra=2


4. Published container ports including addresses :::80, :::443, etc.

[email protected]:~# docker container list
CONTAINER ID   IMAGE                                    COMMAND                  CREATED        STATUS        PORTS                                                                                                                 NAMES
d2415a267196   test_traefik:latest   "/entrypoint.sh trae…"   34 hours ago   Up 32 hours   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:5555->5555/tcp, :::5555->5555/tcp   test_traefik_1


At the same time, nothing is available from the container itself via ipv6

# ping ipv6.google.com
PING ipv6.google.com (2a00:1450:4010:c0d::8b): 56 data bytes
ping: sendto: Network unreachable


and the container ports themselves are not available over ipv6. Everything is fine with ipv4.

Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wexter, 2021-06-06
@Wexter

there is only one address

and did NAT for ipv6 even on the host?

M
Maxim Grishin, 2021-06-07
@vesper-bot

fc00::/7 are strictly local addresses, like 10.0.0.0/8 in ipv4, in order to send something from them somewhere, you need to configure ipv6 NAT on the side of the router (in this case, on the host). Also, you need to check that an ipv6 address is assigned to the adapter in the container, which, it seems, is not observed in your case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question