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

Renew a DHCP lease Internet
Renewing a DHCP lease via the Network System Preference Pane has the advantage of not dropping the connection, unlike switching the interface to BOOTP and back to DHCP. This command mimics that behavior.

It seems that the button creates a key in SystemConfiguration that notifies it to refresh the configuration. We can create that key using the following command (changing en0 for the relevant interface):
echo "add State:/Network/Interface/en0/RefreshConfiguration temporary" | sudo scutil
It has the desired effect on 10.4 through 10.8 – I didn't have access to anything older.
    •    
  • Currently 3.50 / 5
  You rated: 1 / 5 (12 votes cast)
 
[7,400 views]  

Renew a DHCP lease | 4 comments | Create New Account
Click here to return to the 'Renew a DHCP lease' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Renew a DHCP lease
Authored by: dewab on Jan 03, '13 07:54:06AM

Slightly shorter is to just:
# sudo ipconfig set en0 DHCP

(Switching to BOOTP doesn't appear to be necessary)
(Repace en0 with appropriate interface)
Tested with 10.7 & 10.8



[ Reply to This | # ]
Renew a DHCP lease
Authored by: ppp on Jan 03, '13 02:35:32PM

That (sudo ipconfig set en4 DHCP) rendered my Thunderbolt Display Ethernet non-operational. Had to change it to BOOTP in System Preferences and change it back to DHCP to get it working again.



[ Reply to This | # ]
Renew a DHCP lease
Authored by: chymb on Jan 06, '13 04:52:42PM

It also interrupts the connection.



[ Reply to This | # ]
Renew a DHCP lease
Authored by: thejoecarroll on Mar 14, '13 02:53:11AM

Exactly what I needed—thanks!
BTW, remember to change en0 to en1 if it's the Wi-Fi interface's DHCP lease you want to renew (and the Mac has an Ethernet port; en0 is wireless for Airs and Retina MacBook Pros).



[ Reply to This | # ]