Customizing Pi-Hole Addresses
I am trying to setup Pi Hole on Purple for the network segment 172.16.153.0/24. I am doing this so that I can monitor multiple Pi-Hole installations when the offices are connected by VPN.
My configuration file is pasted below.
When I attempt to start up pi-hole I get this message:
pi@Firewalla:~/.firewalla/run/docker/pi-hole (Firewalla Purple) $ sudo docker-compose up --detach
Starting pihole ... error
ERROR: for pihole Cannot start service pihole: Invalid address 172.16.153.2: It does not belong to any of this network's subnets
ERROR: for pihole Cannot start service pihole: Invalid address 172.16.153.2: It does not belong to any of this network's subnets
ERROR: Encountered errors while bringing up the project.
I see that br1: is setup for 172.16.153.1 but br-88abd7897610 (and maybe docker0) aren't correct and I don't know where to make the change.
pi@Firewalla:~/.firewalla/run/docker/pi-hole (Firewalla Purple) $ ifconfig
...
br1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.153.1 netmask 255.255.255.0 broadcast 0.0.0.0
ether 20:6d:31:ee:f4:79 txqueuelen 1000 (Ethernet)
RX packets 72534 bytes 5845355 (5.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 140686 bytes 153905422 (153.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-88abd7897610: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.16.0.1 netmask 255.255.255.0 broadcast 172.16.0.255
inet6 fe80::42:29ff:fe94:33a0 prefixlen 64 scopeid 0x20<link>
ether 02:42:29:94:33:a0 txqueuelen 0 (Ethernet)
RX packets 7228 bytes 501041 (501.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 221 bytes 11085 (11.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:17:f3:7e:91 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
...
I know the problem is in the docker config but I am not sure how to fix it.
root@Firewalla:/home/pi/tools# sudo docker network inspect pi-hole_default
[
{
"Name": "pi-hole_default",
"Id": "88abd7897610fe6ee5083450701051a28c59f9df5002d645222cda56901dc491",
"Created": "2022-06-06T16:07:59.129640869Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.16.0.0/24",
"Gateway": "172.16.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "pi-hole",
"com.docker.compose.version": "1.25.0"
}
}
]
I ran these commands to start pi-hole.
cd /home/pi/.firewalla/run/docker/pi-hole
sudo systemctl start docker
sudo docker-compose pull
sudo docker-compose up --no-start
sudo ip route add 172.16.153.0/24 dev br-$(sudo docker network inspect pi-hole_default |jq -r '.[0].Id[0:12]') table lan_routable
sudo ip route add 172.16.153.0/24 dev br-$(sudo docker network inspect pi-hole_default |jq -r '.[0].Id[0:12]') table wan_routable
sudo docker-compose up --detach
root@Firewalla:/home/pi/.firewalla/run/docker/pi-hole# cat docker-compose.yaml
version: "3"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:v5.1.2
environment:
# set a secure password here or the default will be firewalla
WEBPASSWORD: 'firewalla'
# Volumes store your data between container upgrades
volumes:
- '/data/pi-hole/etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
- '/etc/localtime:/etc/localtime:ro'
restart: unless-stopped
cap_add:
- NET_ADMIN
networks:
default:
# static IP address for pi-hole
ipv4_address: 172.16.153.2
networks:
default:
driver: bridge
ipam:
config:
# your chosen docker network here
- subnet: 172.16.153.0/24
Please sign in to leave a comment.
Comments
0 comments