How to install Pi-Hole on Docker and Synology with MacVlan + Auto Update
How to install Pi-Hole on Docker and Synology with MacVlan
We can create s special 'MacVlan' network, this will allow the pi-hole container to get a dedicated IP on our network. This will solve:
- no port clashes with Synology as all ports will run only on dedicated IP
- Client IP's visible as we are part of the real network
- pi-hole has its own IP we can reach -> almost like a VM but still a container
- You need to install Docker from the Package Center.
- You need to enable "Open vSwitch" under Control panel > Network > Network interface > Select LAN then click Manage.
Networking
Login SSH as root and identify the ovs switch name use the following command.
ip route |grep default
the output will look like this:
default via 192.168.1.1 dev ovs_eth0 src 192.168.1.3
so in my case ovs_eth0 is what I will use.
Next, create the macvlan network name pi-hole-LAN, you need the know the following items:
- Gateway of your network
- The subnet of your network
- Free IP in your network 192.168.1.10/32 "/32 is for one IP,
in my case the command looks like this:
docker network create --driver=macvlan --gateway=192.168.1.1 --subnet=192.168.1.0/24 --ip-range=192.168.1.10/32 -o parent=ovs_eth0 pi-hole-LAN
Run this command to pull the lastest Pi-hole image
docker pull pihole/pihole
Run this command to create a directory for the config files
mkdir -p {/volume1/docker/pihole/pihole,/volume1/docker/pihole/dnsmasq.d}
Thank you Rajani,
ReplyDeleteYou can add schedule to update for the pi-hole image automatically.