Windows 2003 DHCP leases

  • Thread starter Thread starter Net Admin
  • Start date Start date
N

Net Admin

I have a DHCP scope that can hand out 200 IPs. My environment is Windows 2003
Servers in an Active Directory forest at the 2003 functional level.
This scope is used for students' laptops and one computer lab. I have
dynamic DNS updates turned on by request only from the DHCP clients.
The lease duration is set at 1 hour.
Problem: 150 students connect and lease IP addresses for the morning classes
then leave campus 4 hours later. When the afternoon students come in I get
messages from DHCP saying there are only 4 or 5 leases available, the scope
is almost full. The leases that are expired are still showing up in DHCP
under Address Leases so I have to manually go in and delete expired leases in
order for the rest of the students to lease an IP and login to our domain.
Is there an easier way to have expired leases delete themselves?
So far I have implemented a shutdown script the releases the lease but there
are many students that just close the lid of their laptop so the script
doesn't run. I don't want to create a logoff script to release the lease
because there are 24 shared lab computers that use that scope as well.
My last resort is to create VLANS and add more scopes.
Thank You
 
Hi Net,
It sounds as though your problem is that computers come onto the LAN, obtain
a lease, and then leave without releasing it.
You can either give very short leases, or have more addresses. Since you
don't have a problem with the number of active addresses on your LAN, I
would be inclined to increase the number of addresses. There's no problem
with having a large number if they aren't actually in use,
Anthony,
http://www.airdesk.co.uk



"Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
news:B82A78E7-F848-477E-B2A6-BC2B91E911F7@microsoft.com...
>I have a DHCP scope that can hand out 200 IPs. My environment is Windows
>2003
> Servers in an Active Directory forest at the 2003 functional level.
> This scope is used for students' laptops and one computer lab. I have
> dynamic DNS updates turned on by request only from the DHCP clients.
> The lease duration is set at 1 hour.
> Problem: 150 students connect and lease IP addresses for the morning
> classes
> then leave campus 4 hours later. When the afternoon students come in I get
> messages from DHCP saying there are only 4 or 5 leases available, the
> scope
> is almost full. The leases that are expired are still showing up in DHCP
> under Address Leases so I have to manually go in and delete expired leases
> in
> order for the rest of the students to lease an IP and login to our domain.
> Is there an easier way to have expired leases delete themselves?
> So far I have implemented a shutdown script the releases the lease but
> there
> are many students that just close the lid of their laptop so the script
> doesn't run. I don't want to create a logoff script to release the lease
> because there are 24 shared lab computers that use that scope as well.
> My last resort is to create VLANS and add more scopes.
> Thank You
>
 
You may configure your dhcp server to add "002 Microsoft Release DHCP on
shutdown".
So your computers will release the lease on shutdown.

Open the scope whose options you wish to modify.
Select Scope Options, and click the Advanced tab.
Select Microsoft Options from the Vendor class drop-down menu and select
Default User Class from the User class drop-down menu.
Under Available Options, select the "002 Microsoft Release DHCP Lease on
Shutdown Options" check box, as the figure shows. Set its value to one of
these options:
1 = DHCP clients send a DHCPRelease message on proper shutdown, which means
they'll give up their lease.
0 = DHCP clients don't send a DHCPRelease message on proper shutdown, which
means that when the clients restart they'll attempt to renew their existing
lease.

You will choose 1.
Taken from:
http://www.windowsitpro.com/Articles/ArticleID/47131/47131.html


--
Cordialement,
Mathieu CHATEAU
http://lordoftheping.blogspot.com


"Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
news:B82A78E7-F848-477E-B2A6-BC2B91E911F7@microsoft.com...
>I have a DHCP scope that can hand out 200 IPs. My environment is Windows
>2003
> Servers in an Active Directory forest at the 2003 functional level.
> This scope is used for students' laptops and one computer lab. I have
> dynamic DNS updates turned on by request only from the DHCP clients.
> The lease duration is set at 1 hour.
> Problem: 150 students connect and lease IP addresses for the morning
> classes
> then leave campus 4 hours later. When the afternoon students come in I get
> messages from DHCP saying there are only 4 or 5 leases available, the
> scope
> is almost full. The leases that are expired are still showing up in DHCP
> under Address Leases so I have to manually go in and delete expired leases
> in
> order for the rest of the students to lease an IP and login to our domain.
> Is there an easier way to have expired leases delete themselves?
> So far I have implemented a shutdown script the releases the lease but
> there
> are many students that just close the lid of their laptop so the script
> doesn't run. I don't want to create a logoff script to release the lease
> because there are 24 shared lab computers that use that scope as well.
> My last resort is to create VLANS and add more scopes.
> Thank You
>
 
Mathieu, That DHCP option will enable me to eliminate my "ipconfig/release"
shutdown script, thanks for the idea.

Anthony, I only have 200 and no more IPs to lease out. Other devices use the
first 54 or so IPs.

"Mathieu CHATEAU" wrote:

> You may configure your dhcp server to add "002 Microsoft Release DHCP on
> shutdown".
> So your computers will release the lease on shutdown.
>
> Open the scope whose options you wish to modify.
> Select Scope Options, and click the Advanced tab.
> Select Microsoft Options from the Vendor class drop-down menu and select
> Default User Class from the User class drop-down menu.
> Under Available Options, select the "002 Microsoft Release DHCP Lease on
> Shutdown Options" check box, as the figure shows. Set its value to one of
> these options:
> 1 = DHCP clients send a DHCPRelease message on proper shutdown, which means
> they'll give up their lease.
> 0 = DHCP clients don't send a DHCPRelease message on proper shutdown, which
> means that when the clients restart they'll attempt to renew their existing
> lease.
>
> You will choose 1.
> Taken from:
> http://www.windowsitpro.com/Articles/ArticleID/47131/47131.html
>
>
> --
> Cordialement,
> Mathieu CHATEAU
> http://lordoftheping.blogspot.com
>
>
> "Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
> news:B82A78E7-F848-477E-B2A6-BC2B91E911F7@microsoft.com...
> >I have a DHCP scope that can hand out 200 IPs. My environment is Windows
> >2003
> > Servers in an Active Directory forest at the 2003 functional level.
> > This scope is used for students' laptops and one computer lab. I have
> > dynamic DNS updates turned on by request only from the DHCP clients.
> > The lease duration is set at 1 hour.
> > Problem: 150 students connect and lease IP addresses for the morning
> > classes
> > then leave campus 4 hours later. When the afternoon students come in I get
> > messages from DHCP saying there are only 4 or 5 leases available, the
> > scope
> > is almost full. The leases that are expired are still showing up in DHCP
> > under Address Leases so I have to manually go in and delete expired leases
> > in
> > order for the rest of the students to lease an IP and login to our domain.
> > Is there an easier way to have expired leases delete themselves?
> > So far I have implemented a shutdown script the releases the lease but
> > there
> > are many students that just close the lid of their laptop so the script
> > doesn't run. I don't want to create a logoff script to release the lease
> > because there are 24 shared lab computers that use that scope as well.
> > My last resort is to create VLANS and add more scopes.
> > Thank You
> >

>
>
 
About the real reason why it doesn't free up the leases is in the dhcp help:
Leases are retained in the DHCP server database four hours after expiration.
This grace period protects a client lease in case the client and server are
in different time zones, the individual computer clocks are not
synchronized, or the client computer is off the network when the lease
expires. Expired leases are included in the list of active leases and are
distinguished by a different icon.

By default, the cleanup cycle occurs every 60 minutes. You can adjust the
duration of the default grace period after which an expired lease is marked
for deletion by editing the following key in the registry:

Here we go:

So you can remove the 4 hour grace period:
HKLM\System\CurrentControlSet\Services\DHCPServer\Parameters\LeaseExtension
Value Type: DWORD
Value Data: time in minutes

And make the cleanup interval smaller:
HKLM\System\CurrentControlSet\Services\DHCPServer\Parameters\DatabaseCleanupInterval
turn it to half (1e)




http://technet2.microsoft.com/windo...eae9-43a8-9da0-09aff0a71dee1033.mspx?mfr=true


--
Cordialement,
Mathieu CHATEAU
http://lordoftheping.blogspot.com


"Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
news:92845909-DE0F-43AC-AAAC-F0081C4F830D@microsoft.com...
> Mathieu, That DHCP option will enable me to eliminate my
> "ipconfig/release"
> shutdown script, thanks for the idea.
>
> Anthony, I only have 200 and no more IPs to lease out. Other devices use
> the
> first 54 or so IPs.
>
> "Mathieu CHATEAU" wrote:
>
>> You may configure your dhcp server to add "002 Microsoft Release DHCP on
>> shutdown".
>> So your computers will release the lease on shutdown.
>>
>> Open the scope whose options you wish to modify.
>> Select Scope Options, and click the Advanced tab.
>> Select Microsoft Options from the Vendor class drop-down menu and select
>> Default User Class from the User class drop-down menu.
>> Under Available Options, select the "002 Microsoft Release DHCP Lease on
>> Shutdown Options" check box, as the figure shows. Set its value to one of
>> these options:
>> 1 = DHCP clients send a DHCPRelease message on proper shutdown, which
>> means
>> they'll give up their lease.
>> 0 = DHCP clients don't send a DHCPRelease message on proper shutdown,
>> which
>> means that when the clients restart they'll attempt to renew their
>> existing
>> lease.
>>
>> You will choose 1.
>> Taken from:
>> http://www.windowsitpro.com/Articles/ArticleID/47131/47131.html
>>
>>
>> --
>> Cordialement,
>> Mathieu CHATEAU
>> http://lordoftheping.blogspot.com
>>
>>
>> "Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
>> news:B82A78E7-F848-477E-B2A6-BC2B91E911F7@microsoft.com...
>> >I have a DHCP scope that can hand out 200 IPs. My environment is Windows
>> >2003
>> > Servers in an Active Directory forest at the 2003 functional level.
>> > This scope is used for students' laptops and one computer lab. I have
>> > dynamic DNS updates turned on by request only from the DHCP clients.
>> > The lease duration is set at 1 hour.
>> > Problem: 150 students connect and lease IP addresses for the morning
>> > classes
>> > then leave campus 4 hours later. When the afternoon students come in I
>> > get
>> > messages from DHCP saying there are only 4 or 5 leases available, the
>> > scope
>> > is almost full. The leases that are expired are still showing up in
>> > DHCP
>> > under Address Leases so I have to manually go in and delete expired
>> > leases
>> > in
>> > order for the rest of the students to lease an IP and login to our
>> > domain.
>> > Is there an easier way to have expired leases delete themselves?
>> > So far I have implemented a shutdown script the releases the lease but
>> > there
>> > are many students that just close the lid of their laptop so the script
>> > doesn't run. I don't want to create a logoff script to release the
>> > lease
>> > because there are 24 shared lab computers that use that scope as well.
>> > My last resort is to create VLANS and add more scopes.
>> > Thank You
>> >

>>
>>
 
Thank You Mathieu, I believe that's just what I am looking for.
I will post back the end results.

"Mathieu CHATEAU" wrote:

> About the real reason why it doesn't free up the leases is in the dhcp help:
> Leases are retained in the DHCP server database four hours after expiration.
> This grace period protects a client lease in case the client and server are
> in different time zones, the individual computer clocks are not
> synchronized, or the client computer is off the network when the lease
> expires. Expired leases are included in the list of active leases and are
> distinguished by a different icon.
>
> By default, the cleanup cycle occurs every 60 minutes. You can adjust the
> duration of the default grace period after which an expired lease is marked
> for deletion by editing the following key in the registry:
>
> Here we go:
>
> So you can remove the 4 hour grace period:
> HKLM\System\CurrentControlSet\Services\DHCPServer\Parameters\LeaseExtension
> Value Type: DWORD
> Value Data: time in minutes
>
> And make the cleanup interval smaller:
> HKLM\System\CurrentControlSet\Services\DHCPServer\Parameters\DatabaseCleanupInterval
> turn it to half (1e)
>
>
>
>
> http://technet2.microsoft.com/windo...eae9-43a8-9da0-09aff0a71dee1033.mspx?mfr=true
>
>
> --
> Cordialement,
> Mathieu CHATEAU
> http://lordoftheping.blogspot.com
>
>
> "Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
> news:92845909-DE0F-43AC-AAAC-F0081C4F830D@microsoft.com...
> > Mathieu, That DHCP option will enable me to eliminate my
> > "ipconfig/release"
> > shutdown script, thanks for the idea.
> >
> > Anthony, I only have 200 and no more IPs to lease out. Other devices use
> > the
> > first 54 or so IPs.
> >
> > "Mathieu CHATEAU" wrote:
> >
> >> You may configure your dhcp server to add "002 Microsoft Release DHCP on
> >> shutdown".
> >> So your computers will release the lease on shutdown.
> >>
> >> Open the scope whose options you wish to modify.
> >> Select Scope Options, and click the Advanced tab.
> >> Select Microsoft Options from the Vendor class drop-down menu and select
> >> Default User Class from the User class drop-down menu.
> >> Under Available Options, select the "002 Microsoft Release DHCP Lease on
> >> Shutdown Options" check box, as the figure shows. Set its value to one of
> >> these options:
> >> 1 = DHCP clients send a DHCPRelease message on proper shutdown, which
> >> means
> >> they'll give up their lease.
> >> 0 = DHCP clients don't send a DHCPRelease message on proper shutdown,
> >> which
> >> means that when the clients restart they'll attempt to renew their
> >> existing
> >> lease.
> >>
> >> You will choose 1.
> >> Taken from:
> >> http://www.windowsitpro.com/Articles/ArticleID/47131/47131.html
> >>
> >>
> >> --
> >> Cordialement,
> >> Mathieu CHATEAU
> >> http://lordoftheping.blogspot.com
> >>
> >>
> >> "Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message
> >> news:B82A78E7-F848-477E-B2A6-BC2B91E911F7@microsoft.com...
> >> >I have a DHCP scope that can hand out 200 IPs. My environment is Windows
> >> >2003
> >> > Servers in an Active Directory forest at the 2003 functional level.
> >> > This scope is used for students' laptops and one computer lab. I have
> >> > dynamic DNS updates turned on by request only from the DHCP clients.
> >> > The lease duration is set at 1 hour.
> >> > Problem: 150 students connect and lease IP addresses for the morning
> >> > classes
> >> > then leave campus 4 hours later. When the afternoon students come in I
> >> > get
> >> > messages from DHCP saying there are only 4 or 5 leases available, the
> >> > scope
> >> > is almost full. The leases that are expired are still showing up in
> >> > DHCP
> >> > under Address Leases so I have to manually go in and delete expired
> >> > leases
> >> > in
> >> > order for the rest of the students to lease an IP and login to our
> >> > domain.
> >> > Is there an easier way to have expired leases delete themselves?
> >> > So far I have implemented a shutdown script the releases the lease but
> >> > there
> >> > are many students that just close the lid of their laptop so the script
> >> > doesn't run. I don't want to create a logoff script to release the
> >> > lease
> >> > because there are 24 shared lab computers that use that scope as well.
> >> > My last resort is to create VLANS and add more scopes.
> >> > Thank You
> >> >
> >>
> >>

>
>
 
Back
Top