What's new

DNSMASQ as DHCP server for relay requests

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

drewski22785

Occasional Visitor
I am trying to get DNSMASQ to act as DHCP server for relay requests from an upstream device. This device is on a different subnet but is routable.

I see the request come in via tcpdump and via dnsmasq logs, but dnsmasq only assigns the local lan range in response. I found that if I added secondary addresses to br0:X it will reply to the relay requests but then the primary lan starts getting assigned the secondary ip's. I moved the primary LAN to being dhcp relay as well from the upstream device but that made no difference. I have no clue why it replies properly to the secondary addresses via dhcp relay but this breaks the primary ip dhcp requests...

So is there a way to match specifically a dhcp-relay packet so I can remove the secondary addresses and just allow them to route instead? I can't find anything in the request to identify the dhcp-relay server even though in the tcpdump it has the relay server ip. I read something about using option 82 (remote-id/circuit-id) but I can't seem to get the relay to change/add that field to try and match it in the range request.


Here is the dhcp relay config on the upstream router:

dhcp-relay=192.168.15.3,192.168.15.1
dhcp-relay=192.168.12.3,192.168.12.1


Here is the dhcp config on the primary router:

interface=br0
dhcp-range=tag:br0,192.168.15.10,192.168.15.254,255.255.255.0,86400s
dhcp-option=tag:br0,3,192.168.15.1
dhcp-option=tag:br03,6,8.8.8.8,8.8.4.4
dhcp-range=br0,192.168.12.10,192.168.12.254,255.255.255.0,86400s
dhcp-option=br0,3,192.168.12.1
dhcp-option=br0,6,8.8.8.8,8.8.4.4


I am trying to avoid running new cables to create separate br0 br1 br2 etc... Vlans would fix this for sure but the support for vlans seems to be device specific from what I read so trying to avoid that as well.

I saw in windows DHCP there is a setting to match on relay server, so I am hoping there is a way to do something similar with DNSMASQ. Any advice is appreciated. Thanks!
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top