How do I enable IPv6 for Pi-hole in Docker on a Raspberry Pi?

0
10
Asked By TechieTango42 On

I'm trying to set up Pi-hole as a DNS server in Docker on my Raspberry Pi 5, but I'm running into issues with IPv6. My Windows computer tends to skip the Pi-hole because it prioritizes the ISP's IPv6 DNS. I've read conflicting information on whether I need to enable IPv6 in Docker using the /etc/docker/daemon.json file. Some sources say it's not needed anymore, while a YouTube video recommends creating a macvlan network with an IPv6 prefix and gateway. The challenge is that I'm only seeing a link-local address (fe80) instead of a global unicast address (GUA) when I run ipconfig/all. I'm worried I might make routing mistakes if I misuse link-local addresses as my gateway. Here's some context about my network: my LAN is 192.168.86.0/24, the RPi 5 is set to 192.168.86.20, and it has both a '2603' GUA and a fe80 IPv6 address. I have several questions: 1) Should I stick with the bridge network or switch to macvlan for Pi-hole? 2) Is modifying daemon.json necessary? 3) If it is needed, should I use a fe80 prefix or a GUA? 4) If using a GUA, do I go with the prefix provided by my ISP or the fe80? 5) What subnet, IP range, and gateway should I set for IPv6 in the network? Any insights would be greatly appreciated!

3 Answers

Answered By WebWizard91 On

Based on my experience and current best practices, you shouldn’t need to mess with daemon.json anymore with the latest Docker upgrades. There's a newer way to configure routed IPv6 that you should check out. I even wrote a detailed article on it: [www.daryllswer.com/how-to-configure-routed-ipv6-in-docker](https://www.daryllswer.com/how-to-configure-routed-ipv6-in-docker). So according to what I wrote, you can set 'enable_ipv6: true' along with the subnet and gateway, so no need to tinker with daemon.json!

Answered By NetworkNinja3000 On

I didn't end up implementing my original macvlan plan but got satisfactory results. Here’s what I did:
1. I enabled IPv6 for the system default bridge by editing /etc/docker/daemon.json and specifying a random ULA IPv6 range.
2. Discovered that Docker Compose creates a new network by default, which can be adjusted using 'network_mode: bridge' in the compose file.
3. Redeplyoed Pi-hole.
4. Finally, I enabled IPv6 again and pointed the IPv6 DNS directly to the fe80 IP of my Raspberry Pi. Now my queries are properly handled by Pi-hole, and devices are getting a perfect IPv6 score!

Answered By DocuMentor88 On

1. It really depends on whether you want Pi-hole to operate on a separate network (use bridge) or integrate it into your current setup (macvlan).
2. It might vary by Docker version, but enabling IPv6 won’t hurt.
3. You definitely want to avoid using fe80 unless under specific circumstances; stick to a GUA or ULA.
4. Don’t worry about using fe80 for your configuration; it’s link-local and not suitable here.
5. You’ll need to set your Docker network to align with the IPv6 subnet and gateway used in your network, which seems to be linked to the GUA your Pi has for IPv6.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.