2 Intern

 • 

12K Posts

February 11th, 2004 14:00

When you return home, go to Start>Run>type "cmd" without the quotes and then type at the prompt:

ipconfig /release

then

ipconfig /renew

The NIC should then find your connection at home. But, you might also try creating a LAN Connection Named "Home" with your settings for home and name the other one "Work".  Disable the one you don't use.  This should work as I know it works with a wireless card I have.

Message Edited by jmwills on 02-11-2004 11:31 AM

695 Posts

February 11th, 2004 16:00

Yes. I know how to correct the problem when it happens. My wife, however, doesn't -- and doesn't want to know.

I'd like to know anything that I could do to prevent the card (or Windows XP) from saving a 'default' gateway in the first place. When restarted (from shutdown, hybernation, or suspension), the card should broadcast to obtain an address and discover the gateway. It doesn't. I suspect that this is an error in the drivers for the card, but since the 'default gateway' is being stored somewhere (otherwise after shutdown, the card couldn't 'remember' it), I'd like to remove that entry, wherever it may be.

4.4K Posts

February 11th, 2004 17:00

If you look at the output of ipconfig /all, I suspect that the "Default Gateway" and "DHCP Server" have the same IP address. The real problem is that the XP system is attempting to contact the wrong DHCP server to renew its lease.

In your "ipconfig /all" output, are you seeing the correct IP address for the DHCP server, and an incorrect IP address for the default gateway? That implies that there's a manual setting for the default gateway in the TCP configuration for the adapter. If there is one, it should be removed.

The best way to handle this is to configure the DHCP servers so they tell the client to release the lease at shutdown. This is possible to do with the Microsoft and Internet Software Consortium DHCP servers, but I don't know whether it's available in any of the "SOHO" DHCP servers built into wireless routers.

Jim

4.4K Posts

February 11th, 2004 18:00

I don't know of any way to tell a client to release a lease at shutdown from any router DHCP servers I've ever worked with.

Unfortunately neither do I! You can see why it's a useful feature, and is available in the Microsoft and ISC DHCP servers. It's intended to resolve exactly this problem.

I believe that a properly functioning network access device should broadcast when starting up and not assume that the DHCP server/gateway is at some predefined address. When contacting that address fails, at least at that point the device should release its lease and seek another.

Whether that happens or not depends on the state of the lease. If less than half of the lease expiration time has passed, the client will attempt a unicast renewal to the listed DHCP server. That should time out, unless there's a route available to reach the "other" DHCP server. After the request times out, the client should then try broadcasting.

If no lease exists, either because a manual release was done before shutdown, or because the "release on shutdown" feature is set up on the DHCP server, the client will do a broadcast immediately on startup.

I suspect that the DHCP server at work is placing some 'Default Gateway' address in the registry. Just don't know where or if I can defeat that.

I really think it's more likely that the initial unicast is because the previous lease isn't expired. The fact that the DHCP server and default gateway are at the same IP address is coincidental.

I wonder if it's a routing issue? The unicast renewal to the "wrong" DHCP server should result in a "network unreachable" or "host unreachable" error from the gateway. That would immediately cause the client to revert to broadcasts. But if the router thinks it's possible to reach the other network, maybe even through the VPN tunnel (which would encapsulate the unicast inside a routeable IP address), then you might get the behavior you're seeing. At work, the router is refusing to route to 192.168.1.x, but at home, the router is willing to attempt to route traffic to 10.18.x.x. It may be possible to deny routing to that network from the SOHO router. Whether that's possible or not depends on what the router is. What model is it?

Could there be a "permanent" route to the 10.18.x.y network on the machine? netstat -r should show that. Is the VPN client set up to start when the machine boots?

Hmmm...I just checked the setup here, and tracert to 10.18.50.2 (just as a sample) times out at the first-hop ISP router. I have our firewall set up to drop all outbound traffic to 10.0.0.0/255.0.0.0, though.

Jim

695 Posts

February 11th, 2004 18:00

Yes. The default gateway and the DHCP server is the same address. At work, the router access is restricted to the company which set up our VPN's. I don't know of any way to tell a client to release a lease at shutdown from any router DHCP servers I've ever worked with.

What is strange is that when I come to work from home, the card automatically finds the correct gateway. Just can't seem to when I come home from work.

I believe that a properly functioning network access device should broadcast when starting up and not assume that the DHCP server/gateway is at some predefined address. When contacting that address fails, at least at that point the device should release its lease and seek another.


I suspect that the DHCP server at work is placing some 'Default Gateway' address in the registry. Just don't know where or if I can defeat that.

695 Posts

February 11th, 2004 19:00

I have no persistent routes listed.

I've tried something, but won't know if it works until I return home.

I've edited the registry:

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/tcpip/Parameters

I changed DontAddDefaultGatewayDefault from 0 to 1.

4.4K Posts

February 11th, 2004 19:00

I have no persistent routes listed.

Could the VPN client quietly add one?

I've been trying to find out where the DHCP-server supplied "release lease on shutdown" flag is stored, and so far I haven't been able to.

I don't know whether I believe this or not, but one seemingly astute person (YoKenny) said that the following registry change...

User Key: [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\DHCP]
Value Name: ReleaseLeaseOnShutdown
Data Type: REG_DWORD (DWORD Value)
Value Data: "1"

User Key: [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Shutdown]
Value Name: FastReboot
Data Type: STRING
Value Data: "0"


applies to XP as well as Win98. Neither one are present in the registry on my Win2K laptop.

All the DHCP lease information I've been able to find is stored under
HKLM/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Interfaces on my Win2K machine. It'd be unlikely, but not impossible, that it's somewhere else for XP.

I'll post back if I find out anything more about "hotwiring" the release lease on shutdown flag.

Jim

695 Posts

February 11th, 2004 19:00

Thanks. Yes, let me know if you find for sure the registry key to release on shutdown.

The VPN client of course adds the gateway when I use it, but it is not entered as persistent. It doesn't show up after the VPN session completes.

It would be nice if there were a database of registry keys, their meanings, and settings. On Microsoft's site you can find some information, the XP help files contain some information, but much of the options available in the registry are not easily discoverable. You not only need to know where a key should be, but what the name of the key is in order to manually add such a thing.

4.4K Posts

February 11th, 2004 19:00

It would be nice if there were a database of registry keys, their meanings, and settings. On Microsoft's site you can find some information, the XP help files contain some information, but much of the options available in the registry are not easily discoverable. You not only need to know where a key should be, but what the name of the key is in order to manually add such a thing.

Wouldn't it, now? :-) I had to reverse engineer the DHCP release lease on shutdown vendor option for the ISC server, because Microsoft's own description of its size was wrong!

Jim

4.4K Posts

February 11th, 2004 22:00

I was searching through the registry for anything about release lease on shutdown when the EMAIL from the Dell Forum server arrived that there'd been an update to this thread!

I still didn't find anything.

I didn't really think that would do it, because I suspect what's wrong is the IP address of the DHCP server. If the IP address could be forced to start as 255.255.255.255. that might do the right thing.

Are you suspending or shutting down the laptop before you bring it home? I've seen similar problems with Win2K laptops that were suspended and moved to another network, but they usually recover within a minute or so.

I'm wondering about putting "ipconfig /release" in as a "logout" script for your (or maybe all local) account(s), or maybe an "ipconfig /release /renew" as a "login" script. Scripts can be specified for local accounts as well as AD domain accounts. I'll have to poke around and figure out how that works, though.

(edit) It can be done with the Group Policy Editor. Both Windows startup/shutdown scripts, and account login/logoff scripts can be specified. Is this XP Pro or Home? I don't think the Group Policy Editor (gpedit.msc) is available on the Home version of XP.

Jim

Message Edited by jimw on 02-11-2004 04:40 PM

695 Posts

February 11th, 2004 22:00

Well, changing the DontAddDefaultGatewayDefault parameter in the registry didn't do anything.

695 Posts

February 11th, 2004 23:00

I'm using XP Pro. I normally just hibernate my system. But this failure to release survives a complete shutdown. Hence, I know that somewhere the server address is being stored -- just don't know where.

Windows scripting is outside my expertise. I've never found even a simple discussion of how to use it.

Sorry this thread is growing so long. As I noted at the first, the problem is simple fixed with a release/renew. But there should be some way to tell the system or the network card to do that automatically (and it should do that automatically by default).

4.4K Posts

February 11th, 2004 23:00

I'm using XP Pro. I normally just hibernate my system. But this failure to release survives a complete shutdown. Hence, I know that somewhere the server address is being stored -- just don't know where.

That's the easy part - it's all in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\(UID of the interface). The difficult part is changing it automatically!

Windows scripting is outside my expertise. I've never found even a simple discussion of how to use it.

Simple ones aren't that tough. But you're right - I had to buy a book before I could figure out how it all worked!

As an attempt, create a batch file containing...

ipconfig /release /renew


On Win2K, and I suspect on XP, login scripts are stored in C:\WINNT\SYSTEM32\GroupPolicy\User\Scripts\Logon. If you start the group policy editor and navigate to User Configuration/Windows Settings/Scripts (Logon and Logoff), then click on "Logon" in the right pane, then click on "Show Files", you'll see the path where the logon scripts need to be stored. That's how I got the path shown above. Place the batch file there, and then add it by clicking on the "Add..." button.

I don't think logins will fail if there are errors in the script. It just doesn't run right.

And yes indeed, I agree that none of this should be needed. There's something wrong, and I haven't been able to spot what it is!

(edit) Did you try the registry hack from this note?

Jim

Message Edited by jimw on 02-11-2004 06:34 PM

695 Posts

February 12th, 2004 01:00

Thanks again. I installed the script (can't seem to find a way to get to the Group Policy Editor. I can search the help file and click on a link, but there should be an easier way).

The script didn't work, so I rewrote to as follows:
ipconfig /release *
ipconfig /renew *

Now it does work. Should provide a good work around for the problem.

BTW, should a script file be named with a .bat extension? I named this one logon.bat .

4.4K Posts

February 12th, 2004 03:00

Thanks again. I installed the script (can't seem to find a way to get to the Group Policy Editor. I can search the help file and click on a link, but there should be an easier way).

Under Win2K, the Group Policy Editor's available under Control Panel/Administrative Tools. The other way is from Start/Run gpedit.msc. In any case, you found it!

The script didn't work, so I rewrote to as follows:
ipconfig /release *
ipconfig /renew *

Now it does work. Should provide a good work around for the problem.

My error. I just tried having "/release" and "/renew" on the same line, and it failed with the following error:

c:\program files\resource kit>ipconfig /release /renew

Error: Command line is incomplete or arguments conflict.
USAGE:
ipconfig [/? | /all | /release [adapter] | /renew [adapter]
| /flushdns | /registerdns
| /showclassid adapter
| /setclassid adapter [classidtoset] ]


It looks like we needed to specify which adapter, or specify it (as "any"), and in two separate invocations of "ipconfig". Once you specified the adapter as "*", for any adapter, it worked. Sorry. I should have tested that.

BTW, should a script file be named with a .bat extension? I named this one logon.bat.

As long as there's a script processor available for the file name's extension (vbs, Visual Basic Script is another one), it should work. I wrote a big, complex VBS for assigning default printers based on the location of the machine once. In your case, either ".bat" or ".cmd" would have worked, because the script processor would be "cmd.exe" in both cases.

I still don't like this fix. What's causing the DHCP client to not restart lease negotiation at the beginning (DHCPDISCOVER broadcast after a timeout attempting DHCPRENEW), like it has in the other cases I've seen?

Jim

Message Edited by jimw on 02-11-2004 09:21 PM

No Events found!

Top