Mailing List os2-wireless_users@2rosenthals.com Archived Message #6638

From: "Lewis G Rosenthal" <os2-wireless_users@2rosenthals.com> Full Headers
Undecoded message
Subject: Re: [OS2Wireless] DHCP: how to force a lease renewal ?
Date: Sun, 28 Feb 2010 14:54:43 -0500
To: OS/2 Wireless Users Mailing List <os2-wireless_users@2rosenthals.com>

Hi, Jordan...

On 02/28/10 02:13 pm, J R FOX thus wrote :
After using fixed-IP DSL for many years, I'm still pretty new to DHCP, which I previously only used as a Guest at others' residences
or offices. The other day, I lost the internet connection towards the end of a few-hours session.  *Every* attempted URL then became a 'Page Not Found.'  This hardly ever happened with the fixed IP + DSL, and when it did it was very obvious that it was some major event, like the local or regional AT&T broadband service being down.  (I think that is much more common around S.D., with TWC, where someone will dig up a cable somewhere in the area, and then Kablooey.)

  
This can happen if the lease has expired and the DHCP server is unavailable (connection broken or down) when it comes time to renew. Depending upon the configuration, a client may simply ignore the expiration and continue with the old lease, however, this won't go very far if that address has already been reassigned to another client, and the routers have all updated their arp tables.
But that's not really the kind of major service interruption I'm talking about.  Far more common is something I've seen at a relative's place, where some kind of "sync" is lost between PC, router, and cable modem, where the connection is re-established by rebooting each of these in a certain order.  I think that what I saw the other day is much more common still, and involves loss / non-renewal of the DHCP lease.  That is, I probably do not need to reboot the computer, or the router, or the cable modem.  So, my question: What is the command (or GUI object, or widget) in eCS to force a new cable connection &/or new lease ?  (And, what is the equivalent thing you can try in Windoze ?  If I was a 'Nix user, I'd ask about that one too.)    
It happens. :-)

In OS/2, you can do this in a couple of ways:

  1. Open the DHCP Monitor in the TCP/IP folder. Ensure that it is
     showing the status of the correct interface (e.g., lan0). Go to
     Actions | Release Lease, followed by Actions | Request Lease. This
     will effectively give up the lease you currently have (whether
     legitimate or not) and request a new one form the nearest
     responding DHCP server.
  2.  From a command prompt, do a dhcpmon -t <Enter> (to kill the DHCP
     monitor, and thus, dump the address), followed by dhcpstrt -i lan0
     (or whichever interface for which you need to lease an address)
     <Enter>. By default, the process will wait 45 seconds for a
     response, and then try in the background. You may speed up the
     foreground -> background stuff by adding a "-d 0" parameter, which
     effectively means "try forever, in the background." dhcpstrt -?
     <Enter> will yield you brief syntax on this. Note that it is also
     helpful when doing this at the command prompt to flush your arp
     cache and your routing table before requesting a new lease (unless
     you're certain that none of this has changed). In that case, the
     sequence of commands would be:

     dhcpmon -t
     arp -fh
     route -f
     dhcpstrt -d 0 -i lan0

If using XWLAN to manage a wireless interface, this can be accomplished by opening the context menu of the widget and going to TCP/IP interface | Reconfigure. It's a beautiful thing.

Under Windows, it's nigh on impossible to do this *without* the command prompt (if someone has a way, please let me know - Access Connections, perhaps, if running a ThinkPad?). Just go to a command prompt and enter:

   ipconfig /release <Enter>
   ipconfig /renew <Enter>

It should come back with your new address information after the /renew operation.

For those newbie *nix users, as with all things on Linux, there are several ways to skin the cat, as it were (no offense to my cat-loving friends on this list). I usually just do:

   dhcpcd -k <Enter> (to release the lease and kill the running instance)
   dhcpcd eth0 <Enter> (to start it up again)

or, with more recent builds, simply:

   dhcpcd -n <Enter> (to renew the existing lease)

On earlier builds of Mac OS X (and older Mac OS versions), it was necessary (if doing this from the desktop) to actually deactivate and then activate the interface, as there was no specific DHCP widget. I'm not sure about Snow Leopard and such. As OS X is essentially BSD underneath the desktop, I would guess (only a guess, as I don't have a Mac handy) that the Linux procedure above should work just fine. ;-)

HTH

--
Lewis
-------------------------------------------------------------
Lewis G Rosenthal, CNA, CLP, CLE
Rosenthal & Rosenthal, LLC                www.2rosenthals.com
Need a managed Wi-Fi hotspot?                www.hautspot.com
visit my IT blog                www.2rosenthals.net/wordpress
-------------------------------------------------------------


Subscribe: Feed, Digest, Index.
Unsubscribe
Mail to ListMaster