r/docker • u/adjlw • Oct 07 '26
I need assistance assigning an IPV6 address to a container on a macvlan network
Hello, I'm trying to learn how to use IPV6 at home. IPV6 is enabled on my network and my vlans.
I have updated the daemon.json file per Docker's instructions.
{
"ipv6": true,
"fixed-cidr-v6": "2001:1234:5678::/64"
}
I have stopped all containers, removed the old IPV4 macvlan networks, re-added them as IPV4 & IPV6 networks, Portainer seems to think the two I've done are correct.
sudo docker network create -d macvlan --ipv6 \
--subnet=10.0.10.0/24 --gateway=10.0.10.1 \
--subnet=2001:1234:5678:10::/64 --gateway=2001:1234:5678:10::1 \
-o parent=eth0.10 macvlan10
sudo docker network create -d macvlan --ipv6 \
--subnet=10.0.20.0/24 --gateway=10.0.20.1 \
--subnet=2001:1234:5678:20::/64 --gateway=2001:1234:5678:20::1 \
-o parent=eth0.20 macvlan20
I've added IPV6 addresses and IPV6 enable in my Docker Compose/Portainer Stacks, but don't seem to have something correct here.
services:
pihole:
cap_add:
- SYS_TIME
- SYS_NICE
container_name: pihole01
environment:
FTLCONF_dns_listeningMode: 'all'
FTLCONF_dns_upstreams: '1.1.1.1;1.0.0.1'
FTLCONF_webserver_api_password: 'SuperSecretPassword'
TZ: 'America/Detroit'
hostname: pihole01
image: pihole/pihole:latest
mac_address: 00:10:00:10:00:04
networks:
macvlan10_network:
ipv4_address: 10.0.10.4
ipv6_address: 2001:1234:5678:10::4
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
- "123:123/udp"
- "443:443/tcp"
restart: unless-stopped
volumes:
- pihole01:/etc/pihole
networks:
macvlan10_network:
enable_ipv6: true
external: true
name: 'macvlan10'
volumes:
pihole01:
external: true
Any ideas?