Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An easy way to send a DHCP 'release' command Network
The university I work at uses its DHCP servers to update a dynamic DNS server when you connect to their wireless network. Sometimes the DNS update gets lost in the shuffle, and you wind up with an IP address but no DNS entry. The solution to the problem is to release your DHCP address and get a new one -- but the Network control panel in Panther only has a "DHCP renew" button (not the same as "release").

I found a message on the web that describes one way around this:
  1. Open the network icon in System Preferences.
  2. Select a new location and call it "None"
  3. Turn off all selected ports. (Show: Network Port Configurations, uncheck all)
  4. Select Apply now.... your done.
Now every time you select location "None," a DHCP release packet will be sent to all active network interfaces and it won't ask for a new one. To get a new DHCP address, just set your location back to "Wireless" or whatever it was before.
    •    
  • Currently 2.33 / 5
  You rated: 1 / 5 (3 votes cast)
 
[35,149 views]  

An easy way to send a DHCP 'release' command | 19 comments | Create New Account
Click here to return to the 'An easy way to send a DHCP 'release' command' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Or...
Authored by: BigMac2 on Apr 02, '04 11:59:45AM

the easies way is to unplug the ethernet cable.

Another way is to put something in the DHCP Client ID field and click on apply



[ Reply to This | # ]
Or...
Authored by: stcanard on Apr 02, '04 01:24:21PM

My university has a rolled out a wireless network covering most of the campus, so ethernet cables aren't very common.

Interesting, I had figured this hint out already, but hadn't actually thought about what was happening when I turned the airport connection off.



[ Reply to This | # ]
Or...
Authored by: herbs on Apr 03, '04 09:15:11AM

Howdy,

On Airport turn the Ariport Card Off and then On again. That should accomplish the same thing.

Good Luck,
Herb Schulz


---
Good Luck,
Herb Schulz



[ Reply to This | # ]
Or...re: Herb's note
Authored by: NeutronMonk on Apr 03, '04 04:32:35PM

Just to flesh out Herb's observation on turning Airport off/on, this is of course most easily accomplished by the Airport menulet in (ahem) the menu bar, no trip to the System Preferences necessary. I also use the location "Automatic" in the Networking panel and have had no problems going seamlessly between my home Airport, my workplace wired Ethernet, or my workplace Airport...



[ Reply to This | # ]
Or...
Authored by: dahjelle on Apr 02, '04 03:52:35PM

Out of curiosity, what is the DHCP Client ID field for, anyway? All I've ever seen is instructions like the above: "Type anything into the DHCP Client ID field." Surely there is a better purpose for it than that?



[ Reply to This | # ]
Or...
Authored by: nat5an on Apr 02, '04 05:28:00PM

Some DHCP servers will require you to use a special ID to get an IP address, Excite @home used to do this. It's a way to prevent random people from connecting to your service.



[ Reply to This | # ]
Or...
Authored by: billabOng on Apr 02, '04 06:31:51PM

I believe it's so you can figure out who's who in your DHCP logs.



[ Reply to This | # ]
The purpose of the DHCP Client Identifier
Authored by: src-kc8rmb on Apr 03, '04 12:50:49PM

The DHCP Client Identifier is just that, a unique (per subnet) identifier (such as a hostname or serial number) allowing the server to identify the client and select the appropriate response. In the absence of a Client Identifier, the "chaddr" field (hardware address) is used.

Since every Ethernet/WiFi device has a unique hardware address w/o any configuration, that's what's used most of the time. Unless the server has specific per client configuration it barely matters which you use.

@HOME and others use this because it's easier for them to restrict who can get an IP address by using a fixed per client id than by forcing customers to accurately provide them a 12 hex digit Ethernet address and change it everytime they change computers or interfaces cards.

The use in logging is secondary, and primarily for network troubleshooting. A client specified field isn't a very good choice for auditing and security purposes.

Changing the client id or entering junk willy-nilly is bad for two reasons:

(1) The protocol basically requires the server to see each different client id (plus the original chaddr) as a different client, forcing the server to keep issuing new leases without invalidating the old (chewing up the IP space).

(2) It greatly increases the likelyhood that you will enter a client id which someone else on your subnet has used. This can result in duplicate IP addresses, which is a major headache (for you too), defeating one of the biggest benefits of DHCP.

For more information, please see RFC 2131: Dynamic Host Configuration Protocol, available whereever your favorite RFC's are given away, not sold (ftp://ftp.rfc-editor.org/in-notes/rfc2131.txt).



[ Reply to This | # ]
Or...
Authored by: tsaar on Apr 04, '04 07:03:38AM

That's interesting.
How does uplugging your etheret cable renew your DHCP lease?
In my experience it doesn't (unless you unplug it for a looooong time, depending on the DHCP server's settings : the ones I used would give you a lease for a day or so....)



[ Reply to This | # ]
Or...
Authored by: Marcot1 on Apr 04, '04 11:45:36AM

When the link is lost the OS shuts the port down and assumes its DHCP lease is now invalid/expired. When ever the connection is reestablished the OS will send out a DHCP request to obtain an IP regardless of the length of it's previous lease.



[ Reply to This | # ]
Or...
Authored by: tsaar on Apr 08, '04 03:46:15PM

Aha....I see....you are right: I just unplugged my ethernet while looking at system.log and sure thing, it knows, shuts down and restarts several things. Cool :)

Well, looks like OsX behaves a lot better than win95 or winNT in that respect. On NT you'd have to be admin to forcibly renew your lease. Don't know about Win2000 or Xp though (but I dont want to /have to anymore...)



[ Reply to This | # ]
An easy way to send a DHCP 'release' command
Authored by: scrod on Apr 02, '04 02:18:18PM
A hint very similar to this was already covered here.

[ Reply to This | # ]
An easy way to send a DHCP 'release' command
Authored by: garroth on Apr 02, '04 06:14:18PM

If this is a regular problem, creating a new location may be the best way. If you just need to do it once in a while, but don't want to create a location, switch to configure manually, apply, back to DHCP, and apply again.



[ Reply to This | # ]
And for us CLI junkies..
Authored by: 3kirt on Apr 02, '04 11:01:12PM

ifconfig en0 down
ifconfig en0 up



[ Reply to This | # ]
ifconfig
Authored by: sudogeek on Apr 03, '04 05:02:32PM

Does this actually send a "release" to the DHCP server or simply shut down the interface locally?



[ Reply to This | # ]
ifconfig
Authored by: sdeleurme on Apr 09, '04 07:48:05PM

Nope. Just shuts down the interface locally. You can prove this for yourself with tcpdump.



[ Reply to This | # ]
ifconfig
Authored by: paulsomm on Oct 09, '05 06:13:11PM

Actually, it does and is the standard way this is accomplished on many unix variants. If your IP isn't changing, it's not your Mac's fault but your DHCP server. Remember, DHCP leases happen one of two ways: 1, the client requests an address and the server agrees to hand it out (this is how renewing an existing lease works) or 2, the DHCP server has an entry for your network card's MAC address and will only hand out the IP it has assigned to it already (this is how static leases work, and how many home-firewalls work until the DHCP lease time is reached).

You may have to delete your entry in your DHCP server if you're not seeing your IP change on the Mac.



[ Reply to This | # ]
An easy way to send a DHCP 'release' command
Authored by: RHV on Apr 03, '04 09:08:05PM
Apple posted an article on this topic about a year ago. See:[/code]THIS[/code].

[ Reply to This | # ]
DHCP time out?
Authored by: redfood on Apr 04, '04 12:57:43AM

Anyone know how to set DCHP to wait longer before timing out?



[ Reply to This | # ]