DHCP Forwarder/DHCP Relay

Just thought I'd give an update to say I've managed to get this working.

I updated to the latest OpenWRT build prior to doing all of this, as I'd read somewhere that DHCP Relay wasnt working in DNSMasq until a really recent version. I was on 19.07.2 previously, so it was a year old.

At first I couldn't get this working via DNSMasq, and I even tried the isc-dhcp-delay package, I could see the discovers and offers coming into the DHCP server on the subnet at the other end of the site to site VPN but their were no acks.

I did a bit more digging with the DNSMasq configuration and the trick that actually got this working was to remove the following lines from /etc/config/dhcp:

config dhcp 'lan'
	option interface 'lan'
	option ignore '1'

Leaving this as just ignore interface just seemed to completely ignore any DHCP discovery completely sent out on the network that would essentially hit the router.

I then added the following to /etc/dnsmasq.conf

dhcp-relay=192.168.0.1,192.168.1.4
dhcp-relay=192.168.0.1,192.168.0.4

The 1st IP is the IP address of the OpenWRT router, and then 2nd IP is the DHCP server.

So far have tested in load balanced DHCP and this works perfectly, also setting to just a standby failover DHCP works perfect too and if you stop the service on one server the other one just takes over as expected.

5 Likes