Setup on Synology Docker

#1

I made this account just to start sharing my experience moving pi-hole to my Synology docker.

Many of you may have seen http://tonylawrence.com/posts/unix/synology/free-your-synology-ports/ and this got me doing some research on macvlan with docker.

If you ssh into your Synology as a root user and use the following command:

docker network create -d macvlan /
–subnet=192.168.0.0/24 /
–ip-range=192.168.0.5/32 /
–gateway=192.168.0.1 /
-o parent=eth0 Pi-hole

This will create a macvlan with the ip forced as a single ip (192.168.0.5) to use as a network for your docker image.You can then create your pi-hole docker image all through the UI now as this network will show up in docker. No port forwarding or anything is needed for your docker image just select Pi-hole as your network and delete bridge in the network section of the interface and set the ServerIP.

Using an IP calculator you can configure this to a single ip in ip-range section of the command.

Now modifying this a little I am trying to get cloudflared DOH running in a docker image but being that I am using eth0 for both pi-hole and cloudflared I am unable to have eth0 talking to itself. I hopefully will have some time over the weekend to further my research on this subject.

0 Likes

assigned diginc #2
0 Likes

#3

Ok a little more messing around tonight I have managed to do a complete setup of Pi-hole using synologies docker UI besides creating the macvlan in SSH above.

I mean complete setup by binding volumes for the etc/pihole and etc/dnsmasq.d to maintain settings even after deleting my docker image or restarting the synology. Pi.hole in the browser takes me to my pihole page. Everthing I tried works as expected and functions just like my pi3 install.

I dont have it set as my DHCP yet because I plan on doing an easy setup guide to install this through the GUI as tony’s UI guide is a little outdated. But to use DCHP it should be as simple as setting a static IP on the synology as pihole is not actually running until the synology has booted completely.

I did manage to get a cloudflared docker instance working but its not quiet how I would like it as I had to send the pihole to the router and have the router send requests from the pihole to the cloudflared container due to the Linux kernel blocking macvlan communication to the host.

0 Likes

#4

Ok here is a little write up I did. I was unable to load the word version to the site so I uploaded the a zip file with the original document but attached pictures of the write up.
The only downside of this is it will only show an IP for the Synology in the pi-hole interface because the Synology uses pi-hole through a docker bridge being that it is unable to contact it through the macvlan.




Pi.zip (387.9 KB)

0 Likes