IP allocatoion from different subnet

Glenn Satchell glenn.satchell at uniq.com.au
Thu Jun 2 16:22:00 UTC 2011


On 06/03/11 01:48, neeraj jain wrote:
> Hi all,
>
> I have different sub net is configured in my dhcp server. I have a sub
> net based on my relay agent IP but no IP pool defined in it. When
> request is coming from the relay agent subnet, I am tring to allocate
> the IP from different sub net but not successful.
>
> Here is the configuration.
>
> relay agent subnet is like below.
>
> subnet 10.161.0.0 netmask 255.255.240.0 {
> option routers 10.161.0.1 ;
> }
>
> And I am trying to allocate the IP from the below pool range.
>
> subnet 10.160.128.0 netmask 255.255.224.0 {
> option routers 10.160.128.1 ;
> pool {
> max-lease-time 36000;
> range 10.160.136.1 10.160.139.254;
> allow members of "SHKODER-CM";
> }
> }
>
> I have also defined the class like this.
>
> class "SHKODER-CM" {
> lease limit 0;
> match if (binary-to-ascii(10,8, ".", packet(24,4)) ="10.161.0.1");
> }
>
>
> But My dhcp server is not giving IP and saying no free lease. Please let
> me know the solution.
>
> Thanks in advance,
> Neeraj jain
>
>
>
> What i am trying to do is allocated the IP from the different subnet
>
>
This will never work as you describe it.

The request that is forwarded by the relay agent fills in a dhcp option 
field with the IP address of the relay. The dhcp server uses this to 
match it with a subnet definition. You don't need any special classes 
or other configuration for this matching to occur.

The "no free leases" message means that the dhcp server could not find 
an appropriate IP address to assign to the request.

For this to work correctly you must define your subnet definitions to 
match the physical network configurations. ranges must also match the 
subnet. For example, if you were to assign hosts on the 10.161.0.0 an 
address such as 10.160.136.1 it will not be able to route packets out of 
that subnet, nor be able to contact the dhcp server to renew the IP address.

If you were to add something like "range 10.161.0.2 10.161.0.100;" to 
the first subnet the dhcp server would correctly assign an address from 
that range because it matches the subnet definition.

Since this looks like a strange setting, perhaps you could explain why 
you wish to give a different IP address to what is assigned to the subnet?

regards,
-glenn



More information about the dhcp-users mailing list