Docker PiHole MacVlan Issues using Synology NAS and Unifi UDM SE -

Thank you for taking the time to reach my post!

Here is my setup:
I am using a Synology NAS with docker running a container with PiHole on it. I have created a MacVlan and I have the container attached to the MacVlan.

Issue:
I can not access the admin console or reach the PiHole spun up in Docker. In the Unifi portal, I the virtual device with the IP assigned, but there is no communication at all with the device.

One last note, I am trying to connect to the PiHole from a different VLAN and all firewall rules are disabled. So essentially it is wide open communication between the VLANS/Subnets.

What am I missing with my config? I have followed multiple guides on this and still not luck . I was wondering if anyone has ever seen this issue with a Unifi network? Is Unifi able to properly handle a MacVlan. Please help!

What's the result of

nslookup pi.hole

If that returns 0.0.0.0, you probably did not set FTLCONF_LOCAL_IPV4(recommended environment variable).

Been here...

You need to add a shim on the host to enable it to talk to the containers that are on the macvlan. Not exclusive to Synology, as I've had to do this on my Raspberry Pi, too.

I've not got around to creating a startup script or anything, but the basic gist of the commands you need to run are:

ip link add home-shim link eth0 type macvlan mode bridge
ip addr add 192.168.1.252 dev home-shim
ip link set home-shim up
ip route add 192.168.1.0/24 dev home-shim

Obviously replace the IP's with the one's relevant to your own macvlan configuration!

Thank you for the input folks! I checked and I did set an IP for FTLCONF_LOCAL_IPV4.

Now for the shim, the vlan/subnet the docker container is set to macvlan at 192.168.90.1. I ran the commands and found this link:

https://www.baeldung.com/ops/docker-communicating-with-containers-on-same-machine

Unfortunately, still no luck! Even when I try to ping the device, it's like nothing is there. I have watched multiple tutorials and followed them to a T for Synology. I don't understand what I am missing here. Any other help would be greatly appreciated!!!

Your macvlan needs to be on the same subnet as your router.

The example on this link uses these IPs:

         subnet: 192.168.2.0/24
        gateway: 192.168.2.1 (your router)
alpine-app-1 IP: 192.168.2.2
alpine-app-2 IP: 192.168.2.3

macvlan interface (shim) IP: 192.168.2.50 
(must be an unused IP on the same subnet)

Are you using different subnets?

Thank you for getting back to me! No, I am keeping the MacVLAN on the same subnet. I am just at a loss.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.