Pool selection based on Giaddr of different subnet

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Mar 13 19:37:09 UTC 2009

Dario Aguilar wrote:

>Hi there, I´m trying to configure a pool 
>selection based on Giaddr but the problem is 
>that Relay Agent IP (Giaddr) doesn't belongs to 
>same subnet as the client pool so I guess I need 
>to define a class that matches this criteria 
>(maybe of sure that I difined in a wrong way). 
>This is not working because it´s saying that 
>network segment is unknown.

OK, two ways to deal with this :

1) Fix the relay agent !

2) Assuming the GIAddr of the relay agent is 
unique to the clients subnet, then simply put an 
extra subnet in a shared-network delcaration like 
this :

shared-network broken_relay_agent {
   subnet netmask { }

   subnet netmask {
     range ...

What this does is tell the DHCP server that the 
two subnets are on the same wire, and so 
addresses in each subnet are interchangeable as 
far as allocating leases to clients in concerned. 
The server will match the GIAddr to one subnet, 
find no available leases, but see that leases are 
available in the other subnet and allocate from 

This will NOT work if the same relay agent serves 
other subnets using the same (wrong) GIAddr.

Without the shared-network, you will NOT get the 
server to allocate a lease to any client in the 
subnet as the server believes that the client is 
on a different network.

>class "WAC" {
>           match if (binary-to-ascii(10,8, ".", packet(24,4)) = "");

You don't need the binary to ascii stuff, you can 
just use hex something like this :
match if (packet(24,4)) = c0:a8:00:01);

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