[Dnsmasq-discuss] DHCPv6 + dhcp-relay + dhcpcd

Simon Kelley simon at thekelleys.org.uk
Mon Sep 1 21:15:13 UTC 2025



On 8/26/25 16:03, Petr Menšík via Dnsmasq-discuss wrote:
> Hello!
> 
> I were just debugging one of our old tests, which tested whether dnsmasq 
> --dhcp-relay worked. Both for IPv6 and IPv4 addresses. But that test 
> were written with dhclient originally and worked fined with that.
> 
> But you might know ISC dhcp client is deprecated and unsupported. There 
> is a nice alternative still supported, dhcpcd. But it requires on 
> difference and that is presence of Router Advertisement Managed flag set.
> 
> dnsmasq has support for --enable-ra to send exactly such advertisements, 
> which will then dhcpcd use to query DHCP server. The problem I see is it 
> requires configured --dhcp-range for the network.
> 
> But using --dhcp-relay and --dhcp-range do not make sense on the same 
> network, right? 

Right.

> Unfortunately dhcpcd just won't even try to send DHCP 
> request to multicast address, until it has indication from the network 
> it should try it.
> 
> I think it would make sense to extend --enable-ra to send RA also from 
> local addresses specified by --dhcp-relay address.

Agreed.

> Or at least have it 
> explicitly enabled by --ra-param=<device>. The similar problem seems to 
> have --dhcp-range=::,static. That won't be used by dhcpcd also, because 
> it did not match correct network.

The --dhcp-range=::,static problem, I don't understand. More explanation 
would be good.

> 
> Would be patches implementing this desired? Do you know any different 
> option, how to test dnsmasq --dhcp-relay with dhcpcd?

Definitely will look at patches. I just looked at what needs to be done, 
and came up with a five-line addition that looked good, but then 
realised that all the timer infrastructure supporting unsolicited RAs is 
predicated on having a struct dhcp_context.

The simplest way to fix that might be to add a struct dhcp_relay * to 
struct dhcp_context and create a context for each relay address with a 
flag set to avoid it's being used anywhere else than in the RA code.

It's a bit messy. I'll keep working on it unless you'd like to have a go.

If you're working on testing dhcp relay, maybe have a look at the new
--dhcp-split-relay option that's in the bleeding edge code. That's IPv4 
only.


Cheers,

Simon.
> 
> Cheers,
> Petr
> 




More information about the Dnsmasq-discuss mailing list