Moonglade

Modern Markdown blogging with AI-powered localization and search.


Make Docker and Swarm truly support IPv6 while preserving visitor IPs

This article presents a complete process for configuring IPv6 for standard Docker containers and Swarm, preserving the real client source address, and safely validating the setup. Custom bridge networks can enable IPv6 and have Docker assign addresses; containers using ULA can also serve external traffic through the host’s public IPv6 address and published ports. Before creating a new Swarm, configure a dual-stack docker_gwbridge; for existing nodes, plan migration according to node type to avoid hastily rebuilding the cluster or losing application state. Swarm ingress can publish ports in host mode, without requiring the backend overlay network to migrate as well. The article also emphasizes distinguishing the TCP peer address from the visitor address forwarded by a reverse proxy, configuring trusted proxies correctly, and separately verifying the domain entry point, origin server IPv4/IPv6, recorded source address, and forged request headers. Troubleshooting should follow the packet path to check routing, firewalls, port publishing, and MTU; after restoring IPv6, recheck exposed ports and monitor both address families separately.

Views 349
Docker IPv6 Swarm Networking