[Dnsmasq-discuss] Re: DNSMASQ - multiple default routes, dependent on address assigned?

richardvoigt at gmail.com richardvoigt at gmail.com
Thu Nov 27 16:38:48 GMT 2008


On Wed, Nov 26, 2008 at 1:53 PM, Simon Kelley <simon at thekelleys.org.uk> wrote:
> John Grant wrote:
>>
>> On 25 Nov 2008, at 21h08, Simon Kelley wrote:
>>
>>  > John Grant wrote:
>>  >> If I am handing out address on multiple networks and each one has
>>  specific settings, e.g. each ip range has a different default gateway,  how
>> would I let dnsmasq know which dhcp-option went with each address
>>  assignment?
>>
>>  > Two steps: first tag each dhcp-rangem statement
>>
>>  > dhcp-range=red-net,192.168.1.0.........
>>
>>  > then tag options which are for a particular range with the same tag
>>
>>  > dhcp-option=red-net,3,192.168.0.4
>>
>>  > untagged options will containue to be sent to all clients.
>>
>>  > Note that is the deafult route is through the machine running dnsmasq,
>> then the defaults will be correct, without any configuration.
>>
>>  > Cheers,
>>
>>  > Simon.
>>
>>
>> Thanks for that, I had the name and option number the wrong way around!
>>
>> On a very related note, I have many dhcp-ranges defined, derived from
>> dhcp-mac and client-ids, and I put  them together,
>> oh what the heck, here is an extract:
>>
>> dhcp-range=net:radio-ethernet,172.20.4.1,172.20.4.254,255.255.0.0,168h
>> dhcp-range=net:radio-wireless,172.21.6.1,172.21.6.254,255.255.0.0,168h
>> dhcp-range=net:ipod-wireless,172.21.7.1,172.21.7.254,255.255.0.0,168h
>>
>> then to make the option specifications easier, I put them together:
>>
>> dhcp-range=network-ethernet,172.20.0.0,172.20.255.255
>> dhcp-range=network-wireless,172.21.0.0,172.21.255.255

But you've not just combined ranges, you've changed the structure of
these lines by taking out the "net:" prefix which has a special
meaning to dnsmasq.

What you probably want is something like:

dhcp-range=net:radio-ethernet,etheropts,172.20.4.1,172.20.4.254,255.255.0.0,168h
dhcp-range=net:radio-wireless,wifiopts,172.21.6.1,172.21.6.254,255.255.0.0,168h
dhcp-range=net:ipod-wireless,wifiopts,172.21.7.1,172.21.7.254,255.255.0.0,168h

which matches (using net:) tags set in the dhcp-host lines, and adds a
new tag to control the options.

Simon, is that possible, to both condition on one tag and add another?


>>
>> unfortunately dnsmasq then thinks that these ranges are OK to give out!
>> I put a catch-all network ahead of these lines:
>>
>> dhcp-range=172.20.6.1,172.20.6.254,12h
>>
>> in the hope that it would offer up that range first, but is there a better
>> way?

Won't help, dnsmasq uses hashing to assign addresses from all over the
available blocks equally.

>>
>> ---
>> john
>>
>
>
> If you need to make a subnet valid for fixed IP addresses, without giving
> dynamic addresses over the whole subnet, just do
>
> dhcp-range=172.20.0.0,static
>
> I'm not quite sure that's what you're trying to achieve, if it isn't, please
> explain more.
>
> Simon.
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>



More information about the Dnsmasq-discuss mailing list