[Dnsmasq-discuss] dhcp-range with ipv6 vlan not working?

Robert Sharp sysadmin at osburn-sharp.uk
Wed Apr 10 21:51:03 UTC 2024


I have set up dnsmasq to provide dhcpv6 addresses for my network using a 
/64 prefix delegated to the LAN interface (enp3s0) using dhcpcd. 
Everything works fine, so I am now trying to extend ipv6 to a vlan I 
have set up for my wifi clients. Again, dhcpcd has obtained and 
delegated another prefix to the vlan only this time its a /68 for some 
reason.

At the moment I have a dhcp-range command for the ipv4 addresses on the 
vlan working as expected, but the ipv6 version does nothing. This is the 
relevant config:

# IPv4 leases

dhcp-range=192.168.0.64,192.168.0.127,24h
dhcp-range=vlan0,10.86.216.128,10.86.216.248,255.255.255.0,24h

#IPv6

enable-ra
dhcp-range=::1,::400,constructor:enp3s0,ra-names,24h
dhcp-range=vlan0,::1,::400,constructor:vlan0,ra-names,24h

A client attached to the vlan gets an ipv4 address as expected but not 
an ipv6. The logs appear to suggest that the context for the vlan never 
gets created?

DHCP, IP range 10.86.216.128 -- 10.86.216.248, lease time 1d
DHCP, IP range 192.168.0.64 -- 192.168.0.127, lease time 1d
DHCPv6, IP range ::1 -- ::400, lease time 1d, template for enp3s0
DHCPv4-derived IPv6 names on enp3s0
router advertisement on enp3s0
DHCPv6, IP range ::1 -- ::400, lease time 1d, template for vlan0
DHCPv4-derived IPv6 names on vlan0
router advertisement on vlan0
DHCPv6, IP range 2001:8b0:1cde:f020::1 -- 2001:8b0:1cde:f020::400, lease 
time 1d, constructed for enp3s0
DHCPv4-derived IPv6 names on 2001:8b0:1cde:f020::, constructed for enp3s0
router advertisement on 2001:8b0:1cde:f020::, constructed for enp3s0
IPv6 router advertisement enabled

What I would expect is the last few lines repeated for vlan0 with its 
own prefix but they are not. I think these lines are generated by 
dhcpv6.c at line 830, so perhaps either construct_worker is not called 
for the vlan interface, for some reason, or it is but it ends up 
executing the else statement at line 834 because somewhere it was 
decided not to "do RA". Or I could be looking in completely the wrong place.

I would welcome any help trying to sort this out.

Best wishes,

Robert Sharp





More information about the Dnsmasq-discuss mailing list