What does XP do with lease for shutdown/restart?

  • Thread starter Thread starter Peabody
  • Start date Start date
P

Peabody

I have two computers connected to my NAT router - a desktop running
MCE2005 connected by wire, and a laptop running Home connected
wirelessly.

It appears that the lease each computer obtains from the router
survives the powering down of all three devices plus the cablemodem.
So I would like to know what, if anything, XP does in the shutdown
or restart process with respect to open leases, and more generally
what it does with respect to the whole network connection.

Is this process detailed anywhere?

Thanks for any help.
 
Peabody said:
I have two computers connected to my NAT router - a desktop running
MCE2005 connected by wire, and a laptop running Home connected
wirelessly.

It appears that the lease each computer obtains from the router
survives the powering down of all three devices plus the cablemodem.
So I would like to know what, if anything, XP does in the shutdown
or restart process with respect to open leases, and more generally
what it does with respect to the whole network connection.

From what I've seen of Windows behavior, Windows does not handle DHCP
properly at shutdown or when disabling interfaces. ipconfig /release and
equivalents in other variants of windows does not actually send a release
to the DHCP server. Nothing that you can do will make Windows release a
DHCP address as far as DHCP servers are concerned. If you have a lot of
Windows systems on your network, I strongly recommend using relatively
short lease times to work around this problem.
 
Peabody wrote:
From what I've seen of Windows behavior, Windows does
not handle DHCP properly at shutdown or when disabling
interfaces. ipconfig /release and equivalents in other
variants of windows does not actually send a release to
the DHCP server. Nothing that you can do will make
Windows release a DHCP address as far as DHCP servers
are concerned. If you have a lot of Windows systems on
your network, I strongly recommend using relatively
short lease times to work around this problem.

Well the problem here is that the DHCP server I'm dealing
with is the one in my wireless router. It's clear that
either the computer or the router is saving the old lease
info through a power-down, and then they just set up the
same lease when powered up. What I want them to do is start
over with a new lease when powered up, which is what always
happened with a direct connection to Cox without the router.

If I fix the connections to specific local IP numbers, so
that DHCP is no longer involved, do leases just go away?
Maybe that would fix it.

Thanks for the response.
 
Peabody said:
Well the problem here is that the DHCP server I'm dealing
with is the one in my wireless router.

That would be your DHCP server in this case.
It's clear that either the computer or the router is saving the old lease
info through a power-down, and then they just set up the same lease when
powered up.

Right. DHCP clients are supposed to explicitly send the DHCP server a DHCP
RELEASE when it's not going to use the lease any more. No version of
Windows does this, even if you explicitly release in ipcfg,
ipconfig, "repair network connection," or disabling the network interface.
Because Windows does not do this, as far as the DHCP server is concerned,
Windows doesn't release the lease.
What I want them to do is start over with a new lease when powered up,
which is what always happened with a direct connection to Cox without the
router.

DHCP doesn't work that way. DHCP servers will always give you the IP of
your last lease, even if it's expired or you have released it (though the
latter is not possible in Windows). DHCP servers identify your computer by
MAC address, if you want DHCP to give you a different IP, you need to
either specifically configure the DHCP server to give you the specific IP
assignment you want. If you can't/won't/don't have access to do that need
to change network cards entirely.
If I fix the connections to specific local IP numbers, so
that DHCP is no longer involved, do leases just go away?

No. You should never, ever statically assign yourself when you're using a
DHCP assigned network. Sooner or later, this *will* cause an IP conflict,
and you will be the cause.
 
Right. DHCP clients are supposed to explicitly send the
DHCP server a DHCP RELEASE when it's not going to use
the lease any more. No version of Windows does this,
even if you explicitly release in ipcfg, ipconfig,
"repair network connection," or disabling the network
interface. Because Windows does not do this, as far as
the DHCP server is concerned, Windows doesn't release
the lease.
DHCP doesn't work that way. DHCP servers will always
give you the IP of your last lease, even if it's expired
or you have released it (though the latter is not
possible in Windows). DHCP servers identify your
computer by MAC address, if you want DHCP to give you a
different IP, you need to either specifically configure
the DHCP server to give you the specific IP assignment
you want. If you can't/won't/don't have access to do
that need to change network cards entirely.

Well, it's not the assigned IP address that's the problem,
it's the lease term that I want to start over. And that's
only because for some reason it isn't renewing mid-term, and
my internet conection gets shut down when it finally
expires. If it would start a new lease term on reboot, as a
practical matter it wouldn't be a problem because I shut
down overnight.

And by the way, I tried doing "ipconfig /release" and
rebooting, and it DID start the term over on reboot. Maybe
my router's DHCP server is just goofy enough to recognize
what happening. Or, maybe the problem all along was that it
was the computer, not the router, that was remembering the
original term and asking for it to be reinstated.

So it appears I do need to figure out how to establish a
shutdown script or batch file, both for MCE and Home.
No. You should never, ever statically assign yourself
when you're using a DHCP assigned network. Sooner or
later, this *will* cause an IP conflict, and you will be
the cause.

It's only the LAN side that would have fixed IPs. I don't
see how that would cause a conflict. Each computer has its
MAC, and would be assigned IPs accordingly at the router.
On the WAN side the router would continue to use DHCP with
the ISP.
 
Peabody said:
Well, it's not the assigned IP address that's the problem,
it's the lease term that I want to start over. And that's
only because for some reason it isn't renewing mid-term, and
my internet conection gets shut down when it finally
expires. If it would start a new lease term on reboot, as a
practical matter it wouldn't be a problem because I shut
down overnight.

And by the way, I tried doing "ipconfig /release" and
rebooting, and it DID start the term over on reboot. Maybe
my router's DHCP server is just goofy enough to recognize
what happening.

Well, you can renew a DHCP lease anytime and the DHCP server handles it in
stride. It kicks the expire time back out like it's a new lease, you just
get the same IP. I wonder why yours isn't renewing automatically midtime.
Or, maybe the problem all along was that it
was the computer, not the router, that was remembering the
original term and asking for it to be reinstated.

I'm not sure what you're getting at here.
So it appears I do need to figure out how to establish a
shutdown script or batch file, both for MCE and Home.

I'm a little confused why you're trying to overengineer what should be an
automatic process. It might help me to know what the end result you're
shooting for (not what steps you want to take to get there)?
It's only the LAN side that would have fixed IPs. I don't
see how that would cause a conflict. Each computer has its
MAC, and would be assigned IPs accordingly at the router.
On the WAN side the router would continue to use DHCP with
the ISP.

Right, but the router could assign the IP that you're using on your LAN to
another computer, resulting in an IP conflict on your LAN. If you want to
set things up manually, I suggest doing this in the router with static DHCP
assignments. If you want to change the client's configuration by hand
instead of working through DHCP, you should disable the DHCP server on the
router first or it can cause problems for you.
 
Back
Top