Option 82 or subnet: who wins?
Simon Hobson
dhcp1 at thehobsons.co.uk
Tue Mar 17 08:14:21 UTC 2009
David McGaughey wrote:
> > Moving the class definition outside the subnet definition means that
>> the class won't have a router or netmask (or other values from that
>> subnet) as inherited values. These values can then be picked up from
>> the lower precedent subnet. Ususally this is what you want and is why
>> the usual thing is to put class definitions in the global scope.
>
>Of all the help and tutoring that you all have provided, this is the most
>unexpected statement of them all. I realize that scope may be placed into a
>class so that it might be inherited within a match. But to have the class
>acquire scope from where it is declared is - unexpected to me. I can't read
>it in the man page. I see some hint there "Each of these declarations
>itself appear within a lexical scope..." But that's a pretty big jump (in my
>mind) to picking up scope from lexical context. Look at this class
>definition:
>
>class "ms_rm116_sw2650_hp1.0.17"
>{
> match if (
> option agent.remote-id = 0:1d:b3:1f:c2:80
> and
> option agent.circuit-id = 0:11
> );
>}
>
>It's a global class definition having nothing to do with subnet or even
>client MAC. Why would lexical context attach scope baggage to it?
>Evidently - it just does. My only reason for placing the class definitions
>into the subnet context was to have it close to the pool that would consume
>it - for debugging: HA!
It comes up regularly in relation to host statements - to the extend
that code was added to spit out a warning if a host statement is
declared anywhere by the global scope. The assumption by many is that
by putting a host statement inside a subnet, it's only valid for a
client in that subnet - instead they end up here with a weird problem
of a client getting the wrong router !
I guess there are things that with hindsight and a clean sheet would
probably have been done differently - I know I've often looked back
at stuff I've done and thought that way. But it's what we've got. A
regular call is for more rules checking, but I think the feeling
there is that it would either be complicated to check, or restrict
flexibility to do so (some people have been "quite creative").
--
Simon Hobson
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the dhcp-users
mailing list