The issue I am facing:
So I am trying to setup my Pi5 as a home server running among other things:
- HomeAssistant
- Pi-Hole over LAN with DHCP and DNS
- Pi-Hole over WLAN with DHCP and DNS for SmartHome devices, as they only use wifi anyways
Details about my system:
I have gotten the ports and stuff sorted out, but my only remaining problem is, that the Pi-Hole container for the IoT stuff doesn't seem to give out IPv6 addresses, or the clients aren't self assigning them one.
As my SmartHome devices are run using Matter over Wifi, IPv6 is essential, as the matter protocol is IPv6 only.
What I have changed since installing Pi-hole:
My current setup is as follows:
- Docker Container (LAN):
services:
pihole-lan:
container_name: pihole-lan
image: pihole/pihole:latest
network_mode: host
environment:
TZ: 'Europe/Berlin'
FTLCONF_webserver_api_password: 'jellyBeansAreGreat'
FTLCONF_dns_interface: 'eth0'
FTLCONF_dns_listeningMode: 'bind'
FTLCONF_dns_upstreams: '1.1.1.1;1.0.0.1'
# Configure DHCP
FTLCONF_dhcp_active: 'true'
FTLCONF_dhcp_start: '192.168.1.100'
FTLCONF_dhcp_end: '192.168.1.200'
FTLCONF_dhcp_router: '192.168.1.1'
FTLCONF_dhcp_ipv6: 'false'
# Volumes store your data between container upgrades
volumes:
# For persisting Pi-hole's databases and common configuration file
- './etc-pihole:/etc/pihole'
cap_add:
- NET_ADMINtime
- SYS_NICE
restart: unless-stopped
No manual edits to the pihole.toml
.
With the containers dnsmasq.conf
looking like (not manually edited), comments removed for the post:
hostsdir=/etc/pihole/hosts
no-resolv
# DNS port to be used
port=53
# List of upstream DNS server
server=1.1.1.1
server=1.0.0.1
cache-size=10000
localise-queries
# Enable query logging
log-queries
log-async
log-facility=/var/log/pihole/pihole.log
bogus-priv
use-stale-cache=3600
# Bind to one interface
interface=eth0
bind-interfaces
domain=lan
local=/lan/
local=/pi.hole/
host-record=pi.hole,0.0.0.0
# DHCP server setting
dhcp-authoritative
dhcp-leasefile=/etc/pihole/dhcp.leases
dhcp-range=192.168.1.100,192.168.1.200,255.255.255.0
dhcp-option=option:router,192.168.1.1
dhcp-rapid-commit
# Advertise the DNS server multiple times to work around
# issues with some clients adding their own servers if only
# one DNS server is advertised by the DHCP server.
dhcp-option=option:dns-server,0.0.0.0,0.0.0.0,0.0.0.0
# Add NTP server to DHCP
dhcp-option=option:ntp-server,0.0.0.0
server=/test/
server=/localhost/
server=/invalid/
server=/bind/
server=/onion/
cache-rr=ANY
filter-rr=ANY
- Docker Container (IoT):
services:
pihole-iot:
container_name: pihole-iot
image: pihole/pihole:latest
network_mode: host
environment:
TZ: 'Europe/Berlin'
FTLCONF_webserver_api_password: 'jellyBeansAreGreater'
# Configure DHCP
FTLCONF_dhcp_active: 'true'
FTLCONF_dhcp_start: '192.168.2.100'
FTLCONF_dhcp_end: '192.168.2.150'
FTLCONF_dhcp_router: '192.168.2.240'
FTLCONF_dhcp_ipv6: 'true'
# Volumes store your data between container upgrades
volumes:
# For persisting Pi-hole's databases and common configuration file
- './etc-pihole:/etc/pihole'
cap_add:
- NET_ADMIN
- SYS_NICE
restart: unless-stopped
Notable edits to the pihole.toml
include:
dnsmasq_lines = [
"listen-address=192.168.2.1",
"listen-address=fe80::387c:89ff:fe74:3358",
"bind-interfaces"
] ### CHANGED, default = []
as the UI doesn't allow for binding to a IP, which seems to be the only way for dnsmasq to not listen on lo0
, which would cause problems with 2 containers in host mode.
Both the IPv4 and the IPv6 address have been manually set via sudo ip addr add IP dev wlan0
.
Interface binding has not been set via the env, as that seems to default bind eth0
, if no interface is specified.
The full dnsmasq.conf
for the container looks like this:
hostsdir=/etc/pihole/hosts
no-resolv
port=53
server=8.8.8.8
server=8.8.4.4
cache-size=10000
localise-queries
log-queries
log-async
log-facility=/var/log/pihole/pihole.log
bogus-priv
use-stale-cache=3600
local-service
domain=lan
local=/lan/
local=/pi.hole/
host-record=pi.hole,0.0.0.0
# DHCP server setting
dhcp-authoritative
dhcp-leasefile=/etc/pihole/dhcp.leases
dhcp-range=192.168.2.100,192.168.2.150,255.255.255.0
dhcp-option=option:router,192.168.2.240
dhcp-rapid-commit
dhcp-option=option6:dns-server,[::]
# Enable IPv6 DHCP variant
dhcp-range=::,constructor:eth0,ra-names,ra-stateless,64
# Add NTP server to DHCP
dhcp-option=option:ntp-server,0.0.0.0
server=/test/
server=/localhost/
server=/invalid/
server=/bind/
server=/onion/
cache-rr=ANY
filter-rr=ANY
#### Additional user configuration - START ####
listen-address=192.168.2.1
listen-address=fe80::387c:89ff:fe74:3358
bind-interfaces
#### Additional user configuration - END ####
It would be great if someone could help me with that issue, as I don't really want to get a second device or something to serve as the router for the IoT network, as that would also make HomeAssistant interfacing with 2 networks more difficult.
The wlan network is hosted by the Pi using hostapd
.
interface=wlan0
driver=nl80211
ssid=Pi5-SmartHome
hw_mode=g
channel=1
macaddr_acl=0
ignore_broadcast_ssid=0
auth_algs=1
wpa=2
wpa_passphrase=KeePGuessinG
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
I have tested wether IPv6 is functioning via my iPhone. It does not display any IPv6 addresses in the network settings, when connected to the IoT wifi network, as opposed to any wifi network.