[Dnsmasq-discuss] Obtaining addresses from dnsmasq via dhcprelay

Simon Kelley simon at thekelleys.org.uk
Wed Mar 11 22:08:04 GMT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/03/15 04:24, Anton wrote:
> Hi.
> 
> I have cisco with ip unnumbered feature enabled. Loopback interface
> has next configuration:
> 
> interface Loopback20 ip address 192.168.21.1 255.255.255.0
> secondary ip address 192.168.20.1 255.255.255.0 no ip redirects 
> end
> 
> and dnsmasq.conf is: 
> --------------------------------------------------- 
> interface=eth0.10 no-ping port=0 log-async=20 
> log-facility=/tmp/dnsmasq.log 
> dhcp-hostsfile=/etc/dnsmasq/dnsmasq.hosts dhcp-leasefile =
> /tmp/dnsmasq.lease
> 
> #dhcp-range=set:r20,192.168.20.2,192.168.20.253,255.255.255.0,12m #
> commented out for test purpose 
> dhcp-range=set:r21,192.168.21.2,192.168.21.253,255.255.255.0,12m
> 
> #dhcp-option = tag:r20, option:router, 192.168.20.1 # commented out
> for test purpose dhcp-option = tag:r21, option:router, 192.168.21.1
>  ---------------------------------------------------
> 
> Cisco sends dhcp requests to dnsmasq always from 192.168.20.1
> source. When using range tagged r20 all works fine, but if using
> range r21 dnsmasq cannot find range with "no address range
> available for DHCP request via 192.168.20.1".
> 
> How to make dnsmasq to use next available range or to use all
> ranges at the same time ?
> 
> For example r20 will be full and how to use next available range ?
> Or how to make dnsmasq to use all available ranges at the same time
> providing that request will always be  received from cisco primary
> loopback interface ip address (192.168.20.1 in this case) ?
> 

There's no way to do this with dnsmasq.

For directly-connected interfaces, it works because you can allocate
the interface an address on each subnet. For DHCP-relays, there's only
a single gateway address in the relayed packet, so only one subnet is
available.

What's needed to fix this is something like the "shared-network"
config the ISC dhcpd has, which would allow you to declare  that
192.168.20.x and 192.168.21.x are the same network segment, and
therefore if the relay says that the host is on 192.168.20/x, then
dnsmasq knows that 192.168.21.x is valid too.

This is an enhancent to dnsmasq that's been on my TODO list for a long
time.


Cheers,

Simon

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlUAvMQACgkQKPyGmiibgrcxGACdGddjqHifa3Zeuynsd70ymoJr
HcoAn39pzXe/WG0CmpIQ7ycaoThdf1mP
=Bcu1
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list