how to give a container an IP in LAN range?

Hi,

I’ve installed pi-hole container and its running on its own IP range of 172.17.0.0/2 with an IP of 172.17.0.2

if i put the DNS setting under DHCP server to 172.17.0.2 it doesnt recieve queries. I need to use the Routers IP (192.168.178.3) along with dst-nat rules to map ports 53 (tcp and udp) and port 80 tcp for admin interface. it works fine

the problem with this is that all DNS queries now come from 1 client on my LAN being 172.17.0.2 (ip assigned to virtual eth interface for the container). I can ping all these networks fine from terminal inside winbox but form any PC on the 192.168.178.0/24 network I cannot ping to 172.17.0.0/24.

I would like to be able to set 172.17.0.2 for DNS and devices actually able to reach it. is that possible?

attach veth to your LAN bridge

Beware that if you’re using the auto-mac feature on that bridge, the container’s random MAC may get chosen when you do this. That in turn may break static DHCP assignment of the router’s IP, etc.

Adding Veth to the bridge, assigning it an iP adress in the same range of 192.168.178.0/24 and rebooting the router did the trick! thx