Pool selection based on Giaddr

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Jun 9 16:16:40 UTC 2016


Nisha Chandy <nchandy at hctc.coop> wrote:

> I was able to get this working.
>  
> By
>  
> class "Vlan451"
>   {
>     match if (binary-to-ascii(10,8, ".", packet(24,4)) ="10.80.2.44");
>   }

You should not need that. This is pretty basic stuff that the server does handle automagically - if set up right.

> shared-network "E451" {
>   subnet 10.80.2.44 netmask 255.255.255.252 {
>     pool {
>       deny members of "Vlan451";
>       range 10.80.2.45;
>       deny dynamic bootp clients;
>     }
>   }
>                                
>   subnet X.170.132.0 netmask 255.255.255.0 {
>   #Vlan451
>     pool
>     {
>       allow members of "Vlan451";
>       range X.170.132.2 192.170.132.253;
>       deny dynamic bootp clients;
>     }
>   }
> }

It might help if you clarified what you are expecting to happen.

> Jun  9 08:59:32 dhcpsvr1 dhcpd: DHCPDISCOVER from 00:06:31:b4:62:a8 via 10.80.2.44: network E451: no free leases

The obvious question here is, are there actually any free leases ?
Did you actually have a class Vlan451 defined ? For example, if class Vlan451 was not defined, then the second pool could never be used (the client can't be a member of a pool if that pool is not defined). And if the address 10.80.2.45 was already leased out then that's not available for leasing.

So, my guess is that you want all clients behind that relay agent to be using the pool 170.132.2-192.170.132.253, and nothing to use the address 10.80.2.45 ? The simple way of doing this is simply to not define the "range 10.80.2.45", leave out all references to Vlan451, and the server will automagically give clients addresses from the 170.132.0 subnet (that's the purpose of the shared network statement).

BTW - is 10.80.2.44 actually the address of an interface ? It's not valid for interface use in the subnet.



More information about the dhcp-users mailing list