Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Networking > how to get a new IP address from DHCP?

how to get a new IP address from DHCP?
Thread Tools
Dedicated MacNNer
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 18, 2003, 08:28 AM
 
How can I force my computer to release the current IP address and get a new one from DHCP server?

Mac Help says: "Open System Preferences, click Network, and choose Network Port Configurations from the Show pop-up menu. Turn off the port that is using DHCP and click Apply Now, then turn the port back on and click Apply Now again."

However, this does not work on LAN in my university. Also, if I disconnect and reconnect ethernet cable, the IP address stays the same throughout the day.

Any suggestions what I can do? Thanks.
PB G4 12" 1.5GHz/1.2GB/100GB/SuperDrive/AE/Mac OS X Tiger
     
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status: Offline
Reply With Quote
Jun 18, 2003, 08:33 AM
 
I don't think there is another way to do that...
     
Fresh-Faced Recruit
Join Date: May 2003
Location: Ewa Beach, HI
Status: Offline
Reply With Quote
Jun 19, 2003, 02:41 AM
 
Originally posted by wunderkind:
How can I force my computer to release the current IP address and get a new one from DHCP server?

Mac Help says: "Open System Preferences, click Network, and choose Network Port Configurations from the Show pop-up menu. Turn off the port that is using DHCP and click Apply Now, then turn the port back on and click Apply Now again."

However, this does not work on LAN in my university. Also, if I disconnect and reconnect ethernet cable, the IP address stays the same throughout the day.

Any suggestions what I can do? Thanks.
My friend google found this
(I'm assuming you're using OSX and you have administrative privileges. Haven't tried it personally.)

From a terminal window, type sudo ipconfig set en0 BOOTP

Then type sudo ipconfig set en0 DHCP

You can alias the 2 commands together and call it someting like "ip-renew" (put them both on the same line, using a semi-colon to separate them) if you need a quick way to run this in the future.
This space intentionally left blank...
     
Mac Elite
Join Date: Dec 2001
Location: Paris, France
Status: Offline
Reply With Quote
Jun 19, 2003, 02:51 AM
 
Originally posted by merlin:
My friend google found this
(I'm assuming you're using OSX and you have administrative privileges. Haven't tried it personally.)

From a terminal window, type sudo ipconfig set en0 BOOTP

Then type sudo ipconfig set en0 DHCP

You can alias the 2 commands together and call it someting like "ip-renew" (put them both on the same line, using a semi-colon to separate them) if you need a quick way to run this in the future.
I think that's the same thing than using the Preference Pane to change conf and re-select conf... but that still avoids the interface
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jun 19, 2003, 01:33 PM
 
Are you trying to get a new address from a different server? Even if you release-renew your existing address, the server will just give the same one back to you in most cases. Why do you want a new address?
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Jun 19, 2003, 03:24 PM
 
Exactly. Most DHCP servers will "reserve" an IP for your computer's MAC address for a certain amount of time of inactivity (normally a week or two). As long as you keep using DHCP within that window (thus resetting the timer), you'll always get the same IP.

So either spoof another MAC address (not recommended), or tell the network admin to release that IP back into the pool so you'll grab a new one.

tooki
     
Posting Junkie
Join Date: Mar 2001
Location: Salamanca, España
Status: Offline
Reply With Quote
Aug 19, 2003, 11:14 AM
 
Originally posted by tooki:
Exactly. Most DHCP servers will "reserve" an IP for your computer's MAC address for a certain amount of time of inactivity (normally a week or two). As long as you keep using DHCP within that window (thus resetting the timer), you'll always get the same IP.

So either spoof another MAC address (not recommended), or tell the network admin to release that IP back into the pool so you'll grab a new one.

tooki
I think the advice merlin gave makes the network drop the IP back into the pool. It works that way for me.
I could take Sean Connery in a fight... I could definitely take him.
     
Admin Emeritus
Join Date: Oct 1999
Location: Zurich, Switzerland
Status: Offline
Reply With Quote
Aug 20, 2003, 09:36 AM
 
It doesn't. Merlin's tip simply renews the DHCP lease. It doesn't tell the DHCP server anything.

Here's the process, slightly simplified:

1. MAC address X asks DHCP server for IP address

2. DHCP server gives IP address to MAC address X, and makes note of that in routing table

3. MAC address X releases IP, either manually, or by shutting down.

4. MAC address X asks DHCP server for IP addy

5. DHCP server looks in table, finds the IP it previously gave to MAC address X, and sends it.

Unless there is a gap of time (the "DHCP lease" specified by the network admin) between steps 3 and 4, you get the same IP address. Forcing the DHCP server to give you a different address can only be done 2 ways: letting the DHCP lease expire, or explicitly telling the DHCP server to forget the association between one MAC address and its associated IP address.

tooki
     
Posting Junkie
Join Date: Mar 2001
Location: Salamanca, España
Status: Offline
Reply With Quote
Aug 28, 2003, 08:07 AM
 
Originally posted by tooki:
It doesn't. Merlin's tip simply renews the DHCP lease. It doesn't tell the DHCP server anything.
I am running a home system with a dhcp server - serving to three computers over airport. One of the computers receives a strange IP from time to time (10.0.1.3) and a wierd router adress (10.0.1.1) instead of 192.168.1.3 as IP and 192.168.1.1 for router adress.

using the method merlin pointed out works to release the silly IP and get the correct IP.

I have no idea why this happens - it only occurs on one of the computers (a PB 12") but the iBook and the eMac receive the correct IP 100% of the time.

Any idea why this is happening? All machines are running OS 10.2.6 and the latest Airport SW.
I could take Sean Connery in a fight... I could definitely take him.
     
Administrator
Join Date: Apr 2001
Location: San Antonio TX USA
Status: Online
Reply With Quote
Aug 28, 2003, 09:34 AM
 
I think there may be another wireless network near you, and your PowerBook is picking up its IP from the wrong access point. This looks like a job for war driving software! Actually you probably only need an application that looks for existing wireless networks, not one that gives you all the details of what it finds, but war driving packages are much more prevalent than survey applications.
Glenn -----
OTR/L, MOT, Tx
     
Mac Elite
Join Date: Sep 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Aug 28, 2003, 12:33 PM
 
Go to Network pref pane > Airport tab. Make sure that "Join most recently used available network" is selected and that the password is remembered.
     
Posting Junkie
Join Date: Mar 2001
Location: Salamanca, España
Status: Offline
Reply With Quote
Sep 4, 2003, 06:02 PM
 
Originally posted by aaanorton:
Go to Network pref pane > Airport tab. Make sure that "Join most recently used available network" is selected and that the password is remembered.
thanks I did that and I've had no problems with the PB for a few days now
I could take Sean Connery in a fight... I could definitely take him.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:05 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2