Docker-nat66 is a daemon managing IPv6 port forwarding for Docker containers. It listens to the docker daemon socket for new containers and adjusts Linux netfilter IPv6 tables according to exposed ports.
With these IPv6 port-forwarding rules place, the container is accessible using IPv6 the same way as it is using the IPv4 port-forwarding managed by the Docker daemon.
## Getting docker-nat66
Docker-nat66 code is written in Go and available on GitHub under Apache licence. To download and build the code (you need the Golang framework):
An initial release [0.1](https://github.com/bstevant/docker-nat66/releases/tag/0.1) is available if you want a pre-build binary.
**DISCLAIMER: This is an early-released code, intended for debugging and getting feedbacks. This code not ready for production. Use at your own risk !**
## Using docker-nat66
### Docker daemon
Your local Docker should allow IPv6 networking for hosted containers. The Docker daemon should run with the following 2 options:
The Docker IPv6 prefix is a /64 prefix used to assign IPv6 addresses to the containers. See the [Docker IPv6 Networking Guide](https://docs.docker.com/engine/userguide/networking/default_network/ipv6/) for more informations.
**We strongly recommend to use as Docker IPv6 prefix an Unicast-Local-Address (RFC 4193) prefix, instead of `2001:db8::/16` or any fancy hexspeak IPv6 prefix. To get your own /48 prefix, just go to this [IPv6 ULA Prefix generator](http://unique-local-ipv6.com/).**
### `iptables` tools
Docker-nat66 requires the `ip6tables` tool to interact with the netfilter IPv6 tables. This tool should be installed on your Linux system.
The **egress interface** is the network interface receiving incoming requests to your containers. This interface should be connected to an IPv6-enabled network (e.g. it should have a global IPv6 address).
The **Docker IPv6 prefix** is the prefix used for container addressing, as explained above.
Once the docker-nat66 daemon is started, it initializes NAT66 in the netfilter tables and listens to docker events to add/remove port-forwarding rules as containers are started or terminated.
When the docker-nat66 daemon is terminated, it should remove any residing NAT66 rules it inserted and the global NAT66 configuration.
## Feedbacks and Bug Reports
As this code is in its very early stage, any feedback is warmly welcome. I am very interested in discussing how this tool can be adapted for Docker production environments where IPv6 is deployed and used.
I am committed to promoting IPv6 usage for more than 10 years and I will really appreciate that the Docker community also embraces IPv6. I hope this tool will help!