-1

I am very frustrated trying to get my Docker setup to work with IPv6. My configuration is the following:

  • Docker Compose Service 1: nginx with network access to the wordpress:php-fpm container in compose service 2
  • Docker Compose Service 2: Wordpress (php-fpm) and MySQL

When I access my Wordpress instance over IPv4, everything works perfectly fine. I can identify the connecting clients individually with their IPv4 addresses. However, when I try to access my site over IPv6, it also responds normally and everything works fine, but the source IP address in the nginx logs is an IPv4 one - the one from Docker's userland proxy.

For now, this isn't a huge deal because everything works fine, but it is going to be a hurdle stopping me to make my site future-proof, as I want to deploy other applications to the same host. For statistics, this will eventually become a problem since all visitors' requests over IPv6 are proxied through Docker and therefore appear to be accessing from the same IP address.

I have tried following the official guide from Docker on enabling IPv6, but it was not clear what to set for fixed-cidr-v6. I have also attempted to use this Docker image to "make it work", but it still required the fixed-cidr-v6 to be set...

Edit: With not clear I mean, what value to set for this key - I'm not sure with which command to use to or how to otherwise obtain the ipv6 address range required... I really am a noob when it comes to networking, I appreciate your patience!

If it is impossible for Docker to handle IPv6 traffic correctly in the near future, I think I probably have to ditch Docker at least for some parts like nginx. Did I miss something that could fix my problem, or maybe what are some of my solutions?

Many thanks in advance! I am still new to this community, so please feel free to point out mistakes.

5
  • What's not clear about fixed-cidr-v6? It's explained in the documentation. To be able to answer this question, I think you need to add what part of it is unclear, and how you interpret it.
    – vidarlo
    Commented Nov 18, 2023 at 20:50
  • @vidarlo I am not sure what value to set in there. I don't know what ip range to place in there to get things work...
    – zhengliw
    Commented Nov 18, 2023 at 21:44
  • An IPv6 subnet that's routed to you.
    – vidarlo
    Commented Nov 18, 2023 at 22:07
  • fixed-cidr-v6 assigns a subnet to the default bridge network, enabling dynamic IPv6 address allocation. is what the documentation says. And it's exactly what it is; it's the subnet that will be used for IPv6 addresses - just like there's a net for IPv4 on the docker network bridges.
    – vidarlo
    Commented Nov 18, 2023 at 22:08
  • @vidarlo Thanks for the information! I'm going to try out my subnet and I think I'll mark this question as closed for now.
    – zhengliw
    Commented Nov 19, 2023 at 9:37

1 Answer 1

1

Those IPv6 CIDR nets need to contain your prefix, out of address space routed to your container host. Routed is important, so routers will be sending the whole range to the container host.

Just like your public IPv4 address, your IPv6 net is something provided by your hosting provider and unique to you. Might look something like 2001:db8:114:8155::/64

As per that document, a few possible places to set these, depending on your container network design. fixed-cidr-v6 for the default bridge, default pools under default-address-pools, or assigned to specific networks such as with --ipv6 --subnet cli option.


docker-ipv6nat does not remove the need to define nets. It is a hack to use NAT to a private ULA address space, which is not usually needed in v6. Because Docker's v6 design is unfortunately immature, even after the improvements on the issues that image cites. One would think large number of containers are an excellent use case of an enormous address space like IPv6...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .