[IPv6] docker only ipv4

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Operations

Member
Dec 29, 2019
78
2
8
I am trying to add IPv6 to my docker server running on Debian 12. I change my IPv6 subnet (from ISP) to something fake. Debian has got a static IPv6 address.

So i add this:

{
“experimental”: true,
“ip6tables”: true
}

to my empty /etc/docker/daemon.json file.

After that i ran:
docker network create --ipv6 --subnet 2c07:b663::/112 ipv6net

After that rebooted.

This is my docker-compose file.

]
version: “2”

services:

adguardhome:

image: adguard/adguardhome

container_name: adguardhome

restart: unless-stopped

volumes:

./config:/opt/adguardhome/work

./config:/opt/adguardhome/conf

/home/nick/NPM/letsencrypt:/opt/adguardhome/ssl

ports:

172.16.20.245:53:53/udp

53:53/tcp

784:784/udp

853:853/tcp

3333:3000/tcp

99:80/tcp

459:443/tcp

networks:

ipv6net:

enable_ipv6: true

ipam:

config:

subnet:2c07:b663:99::/112



Any ideas what i did wrong?
 

Captain Lukey

Member
Jun 16, 2024
57
17
8
I would start at 1. Check host itself has ipv6 etc..

sudo dmesg | grep -i ipv6
sudo lsmod | grep ipv6

and
sysctl net.ipv6.conf.all.disable_ipv6

and finally i run a macvlan and spin up a container attaching to it.. Simple if docker fails to create the macvlan you know its docker and not the host..


docker network create -d macvlan \
--ipv6 \
--subnet=2001:db8:1234:abcd::/64 \
--gateway=2001:db8:1234:abcd::1 \
-o parent=eth0 \
--ipam-driver=default \
--ipam-opt=dhcp=false \
--subnet=0.0.0.0/32 \
ipv6_macvlan_net_marks_test


please change eth0 to match your network interface eg..eth16 etc etc


finally spin up a noddy container..


docker run -it --rm \
--network ipv6_macvlan_net_marks_test \
alpine sh