DHCP leases issue

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

DHCP leases issue

Teja
Hi 
I have configured the dhcp on my local environment  with the configuration as 
=================================
subnet 192.168.3.0 netmask 255.255.255.0 {
        pool {
                range 192.168.3.3 192.168.3.143;
        }
                default-lease-time 120;
                max-lease-time 120;
                option domain-name "example.com";
                option routers 192.168.3.1;
                option subnet-mask 255.255.255.0;
        }
But no client is able to get the IP and in the logs I can see:
DHCPDISCOVER from 84:EF:18:6A:89:DE via 192.168.3.11: network 192.168.3.0/24: no free leases
DHCPDISCOVER from 00:FF:4A:81:D5:A5 via 192.168.3.16: network 192.168.3.0/24: no free leases
But it is not possible and none of the client get the lease from the specified network. I cross checked in the lease file also 
[root@dhcpserver]# cat dhcpd.leases | grep 192.168.3 -A 10 -B 10
[root@dhcpserver]#
It doesn't shows any entry 

Any help is appreciated thanks in advance  

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Bill Shirley-2
Note: two minutes (120 seconds) is a very short lease time.

Are you sure you're looking at the correct lease file?  Your grep says you have no
leases on 192.168.3.x.

Your log entries via looks strange.  I would think it should contain the interface name:
DHCPDISCOVER from 40:4e:36:d2:bf:9d via wifi
DHCPDISCOVER from b4:18:d1:69:02:f9 (Bobs-iPhone) via wifi


Bill

On 9/6/2019 6:25 AM, Surya Teja wrote:
Hi 
I have configured the dhcp on my local environment  with the configuration as 
=================================
subnet 192.168.3.0 netmask 255.255.255.0 {
        pool {
                range 192.168.3.3 192.168.3.143;
        }
                default-lease-time 120;
                max-lease-time 120;
                option domain-name "example.com";
                option routers 192.168.3.1;
                option subnet-mask 255.255.255.0;
        }
But no client is able to get the IP and in the logs I can see:
DHCPDISCOVER from 84:EF:18:6A:89:DE via 192.168.3.11: network 192.168.3.0/24: no free leases
DHCPDISCOVER from 00:FF:4A:81:D5:A5 via 192.168.3.16: network 192.168.3.0/24: no free leases
But it is not possible and none of the client get the lease from the specified network. I cross checked in the lease file also 
[root@dhcpserver]# cat dhcpd.leases | grep 192.168.3 -A 10 -B 10
[root@dhcpserver]#
It doesn't shows any entry 

Any help is appreciated thanks in advance  

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Niall O'Reilly
On 6 Sep 2019, at 20:03, Bill Shirley wrote:

> Your log entries via looks strange.  I would think it should contain
> the interface name:

For on-link clients, yes. For remote clients, the relay address is shown
instead of the interface name.

Niall O'Reilly
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Teja
In reply to this post by Bill Shirley-2
Hi Bill,

Thanks for reply as suggested i have increased lease time to one hour and I observerd one more scenario when the client moves from one subnet to another subnet ( lease time say 1hr). The client got IP from the second subnet scope but the previous IP in the 1st subnet is still in hold and in the lease file. It still recorded an active entry. How can the dhcp server reclaims those unused IP's? Do we have any configuration statement making dhcp to cross check all the active IP's of that scope before saying no free leases.
The first IP is getting into free state after completing its 1 hour lease duration till that time it is active mode only.

Thanks in advance.

On Sat, 7 Sep 2019, 00:33 Bill Shirley, <[hidden email]> wrote:
Note: two minutes (120 seconds) is a very short lease time.

Are you sure you're looking at the correct lease file?  Your grep says you have no
leases on 192.168.3.x.

Your log entries via looks strange.  I would think it should contain the interface name:
DHCPDISCOVER from 40:4e:36:d2:bf:9d via wifi
DHCPDISCOVER from b4:18:d1:69:02:f9 (Bobs-iPhone) via wifi


Bill

On 9/6/2019 6:25 AM, Surya Teja wrote:
Hi 
I have configured the dhcp on my local environment  with the configuration as 
=================================
subnet 192.168.3.0 netmask 255.255.255.0 {
        pool {
                range 192.168.3.3 192.168.3.143;
        }
                default-lease-time 120;
                max-lease-time 120;
                option domain-name "example.com";
                option routers 192.168.3.1;
                option subnet-mask 255.255.255.0;
        }
But no client is able to get the IP and in the logs I can see:
DHCPDISCOVER from 84:EF:18:6A:89:DE via 192.168.3.11: network 192.168.3.0/24: no free leases
DHCPDISCOVER from 00:FF:4A:81:D5:A5 via 192.168.3.16: network 192.168.3.0/24: no free leases
But it is not possible and none of the client get the lease from the specified network. I cross checked in the lease file also 
[root@dhcpserver]# cat dhcpd.leases | grep 192.168.3 -A 10 -B 10
[root@dhcpserver]#
It doesn't shows any entry 

Any help is appreciated thanks in advance  

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Thomas Markwalder
If you're clients are roaming between networks and are not releasing leases you may wish to use this flag:


The one-lease-per-client statement

one-lease-per-client flag;

If this flag is enabled, whenever a client sends a DHCPREQUEST for a particular lease, the server will automatically free any other leases the client holds. This presumes that when the client sends a DHCPREQUEST, it has forgotten any lease not mentioned in the DHCPREQUEST - i.e., the client has only a single network interface and it does not remember leases it’s holding on networks to which it is not currently attached. Neither of these assumptions are guaranteed or provable, so we urge caution in the use of this statement.



On 9/6/19 11:47 PM, Surya Teja wrote:
Hi Bill,

Thanks for reply as suggested i have increased lease time to one hour and I observerd one more scenario when the client moves from one subnet to another subnet ( lease time say 1hr). The client got IP from the second subnet scope but the previous IP in the 1st subnet is still in hold and in the lease file. It still recorded an active entry. How can the dhcp server reclaims those unused IP's? Do we have any configuration statement making dhcp to cross check all the active IP's of that scope before saying no free leases.
The first IP is getting into free state after completing its 1 hour lease duration till that time it is active mode only.

Thanks in advance.

On Sat, 7 Sep 2019, 00:33 Bill Shirley, <[hidden email]> wrote:
Note: two minutes (120 seconds) is a very short lease time.

Are you sure you're looking at the correct lease file?  Your grep says you have no
leases on 192.168.3.x.

Your log entries via looks strange.  I would think it should contain the interface name:
DHCPDISCOVER from 40:4e:36:d2:bf:9d via wifi
DHCPDISCOVER from b4:18:d1:69:02:f9 (Bobs-iPhone) via wifi


Bill

On 9/6/2019 6:25 AM, Surya Teja wrote:
Hi 
I have configured the dhcp on my local environment  with the configuration as 
=================================
subnet 192.168.3.0 netmask 255.255.255.0 {
        pool {
                range 192.168.3.3 192.168.3.143;
        }
                default-lease-time 120;
                max-lease-time 120;
                option domain-name "example.com";
                option routers 192.168.3.1;
                option subnet-mask 255.255.255.0;
        }
But no client is able to get the IP and in the logs I can see:
DHCPDISCOVER from 84:EF:18:6A:89:DE via 192.168.3.11: network 192.168.3.0/24: no free leases
DHCPDISCOVER from 00:FF:4A:81:D5:A5 via 192.168.3.16: network 192.168.3.0/24: no free leases
But it is not possible and none of the client get the lease from the specified network. I cross checked in the lease file also 
[root@dhcpserver]# cat dhcpd.leases | grep 192.168.3 -A 10 -B 10
[root@dhcpserver]#
It doesn't shows any entry 

Any help is appreciated thanks in advance  

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Simon Hobson
In reply to this post by Teja
Surya Teja <[hidden email]> wrote:

> Thanks for reply as suggested i have increased lease time to one hour and I observerd one more scenario when the client moves from one subnet to another subnet ( lease time say 1hr). The client got IP from the second subnet scope but the previous IP in the 1st subnet is still in hold and in the lease file. It still recorded an active entry. How can the dhcp server reclaims those unused IP's?

You CANNOT do that without violating the DHCP specification. Note that the client is within it's rights to store all the leases it has, and on returning to the previous subnet, continue using the lease it still has for that subnet. So if the server has handed the address out to another client in the meantime, you can have an address clash.
So short version "do NOT do that" !

> The first IP is getting into free state after completing its 1 hour lease duration till that time it is active mode only.

That is correct operation.

The correct response to "I don't have enough addresses" is to increase the size of the address pool(s). It's a balancing act - on the one hand longer leases give you stability and more time to respond to DHCP server issues; while on the other hand, shorter leases suit highly mobile users (high churn rate). For short leases, even 60 minutes is (IMO) getting rather short - you only need one hiccup with your DHCP service and your users have between 30 and 60 minutes before they fall off the network and call your helpdesk.

If you are finding that you run out of leases then it suggests you have your network design wrong. There is LOTS of address space in the RFC1918 blocks, and you are certainly not constrained to use /24 subnets in the 192.168.n.n allocation. Use 10.n.n.n/8 and you have 16 million addresses to play with !


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Teja
Hi Simon,
Thanks for reply, Yes I can increase the scope range but i have clients like 100-120 per floor(per subnet) I don't think it would be good idea to increase its scope size to some /8 subnet  and over come this issues 
Let me explain the scenario. If the client moved from subnet A and subnet B we may not sure that client returning to previous subnet for that whole working day or not.
So the IP assigned to that client in subnetA  is of no use for period of duration. This happens to multiple IP's
I want to set the config in such a way that before DHCP granting the lease can it check the existing lease file with that mac address and free the previous ones if it has from other subnets or scope.
As suggested by Thomas I have added the statement one-lease-per-client true to config and till now I didn't see any issues but as it is not sure I am still observing the cases.

On Sun, Sep 8, 2019 at 4:00 AM Simon Hobson <[hidden email]> wrote:
Surya Teja <[hidden email]> wrote:

> Thanks for reply as suggested i have increased lease time to one hour and I observerd one more scenario when the client moves from one subnet to another subnet ( lease time say 1hr). The client got IP from the second subnet scope but the previous IP in the 1st subnet is still in hold and in the lease file. It still recorded an active entry. How can the dhcp server reclaims those unused IP's?

You CANNOT do that without violating the DHCP specification. Note that the client is within it's rights to store all the leases it has, and on returning to the previous subnet, continue using the lease it still has for that subnet. So if the server has handed the address out to another client in the meantime, you can have an address clash.
So short version "do NOT do that" !

> The first IP is getting into free state after completing its 1 hour lease duration till that time it is active mode only.

That is correct operation.

The correct response to "I don't have enough addresses" is to increase the size of the address pool(s). It's a balancing act - on the one hand longer leases give you stability and more time to respond to DHCP server issues; while on the other hand, shorter leases suit highly mobile users (high churn rate). For short leases, even 60 minutes is (IMO) getting rather short - you only need one hiccup with your DHCP service and your users have between 30 and 60 minutes before they fall off the network and call your helpdesk.

If you are finding that you run out of leases then it suggests you have your network design wrong. There is LOTS of address space in the RFC1918 blocks, and you are certainly not constrained to use /24 subnets in the 192.168.n.n allocation. Use 10.n.n.n/8 and you have 16 million addresses to play with !


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Simon Hobson
Surya Teja <[hidden email]> wrote:
> Thanks for reply, Yes I can increase the scope range but i have clients like 100-120 per floor(per subnet) I don't think it would be good idea to increase its scope size to some /8 subnet  and over come this issues

You don't need to go to a /8, I was just illustrating that there is no shortage of private addressing available. it would be a bad idea anyway, very large pools increase the memory footprint and startup time for the DHCP server. You could either supernet 192.168.n.n addresses and use /23 or /22, or use the 172.16/12 space and subnet it to /23 or /22 to get plenty of space.

> Let me explain the scenario.

I understand fully the scenario - it's a common one.

> As suggested by Thomas I have added the statement one-lease-per-client true to config and till now I didn't see any issues but as it is not sure I am still observing the cases.

I would recommend against using that. Yes it "works", and will probably work without problem "most" of the time. But the fact that is mostly works OK is down to DHCP clients having been developed to cope with broken networks - with things like checking for duplicate addresses before re-using an existing lease on bringing up a network connection. Because "fixing" the problem by breaking the DHCP server will cause duplicate addressing given the level of churn your previous statements suggest.
Specifically: Client 1 moved from subnet A to subnet B, with one-lease-per-client set, the server will release the client's lease in subnet A. Client 2 joins subnet A, and depending on the level of churn may get the address previously leased to client 1. Client 1 now returns to subnet A, find that it has a valid lease for the network, but ... oops, that address is being used by someone else. There are clients around that will try to use the address and you'll get problems.
At the very least, by running with such a small DHCP pool size and roaming clients, you are forcing a lot of churn which isn't necessary.

If you were to switch to a /22 subnet, you could easily have a pool in the order of 1000 addresses per subnet - that would make the problem just go away unless many hundreds of clients all went on a roaming spree. In the long term, renumbering the network will be less hassle than dealing with the random failures you could see - I know it's a PITA, been there, more than once. Also dealt with supposedly knowledgeable network people who can't grasp anything other than a /24 !

BTW - are at least some of these clients using WiFi ? If so then be aware that having different subnets per floor may give you some "interesting" roaming issues. Clients could easily switch from an access point for "their" floor to another access point for the floor above or below. If they do this, then they'll switch subnet and all their connections will break.
How much of a problem this is depends on the application. Some will simply re-connect, others will break.

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP leases issue

Thomas Markwalder
Simon is quite right in his assessment of the one-lease-per-client
flag.  It "works" but it does so by bending the rules and it is
certainly a use-at-your-own-peril approach. The man page entry for it
does mention this.

On 9/10/19 4:37 PM, Simon Hobson wrote:

> Surya Teja <[hidden email]> wrote:
>> Thanks for reply, Yes I can increase the scope range but i have clients like 100-120 per floor(per subnet) I don't think it would be good idea to increase its scope size to some /8 subnet  and over come this issues
> You don't need to go to a /8, I was just illustrating that there is no shortage of private addressing available. it would be a bad idea anyway, very large pools increase the memory footprint and startup time for the DHCP server. You could either supernet 192.168.n.n addresses and use /23 or /22, or use the 172.16/12 space and subnet it to /23 or /22 to get plenty of space.
>
>> Let me explain the scenario.
> I understand fully the scenario - it's a common one.
>
>> As suggested by Thomas I have added the statement one-lease-per-client true to config and till now I didn't see any issues but as it is not sure I am still observing the cases.
> I would recommend against using that. Yes it "works", and will probably work without problem "most" of the time. But the fact that is mostly works OK is down to DHCP clients having been developed to cope with broken networks - with things like checking for duplicate addresses before re-using an existing lease on bringing up a network connection. Because "fixing" the problem by breaking the DHCP server will cause duplicate addressing given the level of churn your previous statements suggest.
> Specifically: Client 1 moved from subnet A to subnet B, with one-lease-per-client set, the server will release the client's lease in subnet A. Client 2 joins subnet A, and depending on the level of churn may get the address previously leased to client 1. Client 1 now returns to subnet A, find that it has a valid lease for the network, but ... oops, that address is being used by someone else. There are clients around that will try to use the address and you'll get problems.
> At the very least, by running with such a small DHCP pool size and roaming clients, you are forcing a lot of churn which isn't necessary.
>
> If you were to switch to a /22 subnet, you could easily have a pool in the order of 1000 addresses per subnet - that would make the problem just go away unless many hundreds of clients all went on a roaming spree. In the long term, renumbering the network will be less hassle than dealing with the random failures you could see - I know it's a PITA, been there, more than once. Also dealt with supposedly knowledgeable network people who can't grasp anything other than a /24 !
>
> BTW - are at least some of these clients using WiFi ? If so then be aware that having different subnets per floor may give you some "interesting" roaming issues. Clients could easily switch from an access point for "their" floor to another access point for the floor above or below. If they do this, then they'll switch subnet and all their connections will break.
> How much of a problem this is depends on the application. Some will simply re-connect, others will break.
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users