Table of Contents
1. Introduction
You may think how to create network with IPv6 addresses in Docker.
I will show you right away with ready to copy/paste code snippets that you can use.
2. Create Subnet Address for Network
With FREE Tool IPv6 Network Generator from toughcoding.net you can quickly generate your desired network. Just click on ‘Generate’ button and you will get example addresses:
Generated ULA Prefix:
fd873bfeafab::/64
Example IPv6 Addresses:
fd873bfeafab::1
fd873bfeafab::2
fd873bfeafab::3
fd873bfeafab::4
fd873bfeafab::5
3. Create network in Docker
Time to create docker network using above data. Use ULA Prefix with colons to separate each 4 digits.
docker network create --ipv6 --subnet fd87:3bfe:afab::/64 ip6net
4. Run Example Image to Test
Run below container
docker run --rm --network ip6net -p 80:80 traefik/whoami
# 2024/09/01 19:11:51 Starting up on port 80
Connect to container to see output about network
curl "http://[::1]:80"
response:
Hostname: 7e3bf36db2a7
IP: 127.0.0.1
IP: ::1
IP: 172.30.0.2
IP: fd87:3bfe:afab::2
IP: fe80::42:acff:fe1e:2
RemoteAddr: 192.168.65.1:40485
GET / HTTP/1.1
Host: [::1]
User-Agent: curl/8.4.0
Accept: */*
5. Summary
In this tutorial you have learned how to quickly startup docker image in IPv6 network with help of FREE network addresses generator.
Have a nice coding!