Specify different pxeclients "next-server" for different subnet?

David W. Hankins David_Hankins at isc.org
Mon Jan 12 17:19:37 UTC 2009

On Mon, Jan 12, 2009 at 11:52:03AM -0500, Drew Weaver wrote:
> Now that I think about it, the server might not accept an IP address here; 
> in theory, the RHS of an assignment can be any expression type, but I can't 
> remember if the parser is clever enough to do the right thing with an IP 
> address.  Perhaps someone who touches the parser internals more often than 
> I would like to comment (David?).

I think anything on the right hand side of an '=' being used in
assignment is a data expression, and data expressions are either
functions that return data expressions, or colon-separated

This is why if you over-ride the PRL with a concat() (whose arguments
are defined as data expressions, and so parsed that way), you have to
specify hex.

But I've been surprised by the parser before.  It could be it tries
to determine the type of expression first before parsing.  The easy
answer is to try it and see what you get.

> Is it possible to put classes inside of subnets and not globally, or can you think of any other way that I could achieve this?

No, class matches are searched globally.  Nesting a class (or host, or
group) creates a hierarchical tree of configuration state.  Placing
the class inside a subnet, for example, causes the class to inherit
all configuration parameters defined in the subnet (but the class is
still searched globally).  This can be beneficial in some contrived
circumstances, but usually causes a host to get the 'option routers'
for the wrong subnet due to its class match.

> It seems like it should be fairly trivial to assign separate next-server options for PXEClients on a per subnet basis.

Presuming a single class that matches all PXEClients, you could scope
the next-server parameter in a small pool inside each subnet, that
serves only pxeclients.  In this case, be sure to also reduce
max-lease-time.  You might also use non globally routed addresses that
have been colocated on the subnet (inside a shared-network).

You can also use an executable statement scoped inside the subnet;
this is approximately equivalent in workload for the server to using
a class match (because this statement is scoped inside the subnet,
it alone is found to execute when processing a reply).

  if (substring(option vendor-class-identifier, 0, 3) = "PXE") {
    next-server foo;

David W. Hankins	"If you don't do it right the first time,
Software Engineer		     you'll just have to do it again."
Internet Systems Consortium, Inc.		-- Jack T. Hankins
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20090112/3345efc6/attachment.bin>

More information about the dhcp-users mailing list