[Dnsmasq-discuss] Option 82 and a Default Pool
Simon Kelley
simon at thekelleys.org.uk
Thu Feb 3 07:52:51 GMT 2011
On 03/02/11 07:01, Mike O'Connor wrote:
> Hi All
>
> I'm attempting to assign dynamic and static ip address using dhcp option
> 82 information.
>
> After reading the mail archives I was able to get static address to be
> assigned after building a 2.55 version into a deb package for Ubuntu 10.04.
>
> The config below works as long as I remove the 'default'. In an attempt
> to fix the issue I added the tag called 'locked' hoping this would block
> out the default but it does not seem too.
>
> # Switch Mac
> dhcp-remoteid=set:aurora-1,00:06:00:15:62:a7:64:00
>
> # Port Vlan and ID
> dhcp-circuitid=set:vlan-500-port-1,00:04:01:f4:00:00
> dhcp-circuitid=set:vlan-500-port-2,00:04:01:f4:00:01
> dhcp-circuitid=set:vlan-500-port-3,00:04:01:f4:00:02
> dhcp-circuitid=set:vlan-500-port-4,00:04:01:f4:00:03
> dhcp-circuitid=set:vlan-500-port-5,00:04:01:f4:00:04
>
> dhcp-option=option:router,192.10.101.1
> dhcp-option=option:dns-server,192.10.96.192,192.10.96.193
>
> #Statics
> dhcp-range=tag:aurora-1,tag:vlan-500-port-1,set:locked,192.10.101.242,192.10.101.242,255.255.255.0,192.10.101.255,10m
> dhcp-range=tag:aurora-1,tag:vlan-500-port-3,set:locked,192.10.101.243,192.10.101.243,255.255.255.0,192.10.101.255,10m
> dhcp-range=tag:aurora-1,tag:vlan-500-port-5,set:locked,192.10.101.245,192.10.101.245,255.255.255.0,192.10.101.255,10m
>
> #Default
> dhcp-range=tag:!locked,192.10.101.230,192.10.101.239,255.255.255.0,10m
>
> I'm sure the issue is something simple but for the live of me I can not
> see it.
>
The problem is that you can't use a tag (in this case "locked") which
are evaluated in the dhcp-range statements in other dhcp-range
statements. dnsmasq picks a single dhcp-range and then adds any set:
tags in it for use in adding options, but by that time the dhcp-range in
use can't be altered. This should be better documented.
The solution is to explicitly evaluate the value of "locked", which is
most easily done as "not-locked" using De-Morgan's theorem
tag-if = set:not-locked, tag:!vlan-500-port-1, tag:!vlan-500-port-3,
tag:!vlan-500-port-5
and then change your last dhcp-range to be
#Default
dhcp-range=tag:not-locked,192.10.101.230,192.10.101.239,255.255.255.0,10m
Ignore inappropriate line wrap in above, obviously.
HTH
Simon.
More information about the Dnsmasq-discuss
mailing list