Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From the Terminal, how can I release and renew my DHCP lease?

Currently, I'm doing the following for the wireless interface, but I'm wondering if there's a better way:

sudo ifconfig en1 down
sudo ifconfig en1 up

For the wired interface, replace en1 with en0.

share|improve this question
Are you waiting for someone to say, no - there is no better way or can we address your question / edit it so it's likely to get a different answer than ue ipconfig/ifconfig? – bmike Dec 26 '12 at 15:41

This can also be achieved with the following two commands :

sudo ipconfig set en0 BOOTP
sudo ipconfig set en0 DHCP

You can alias the two together in your bash profile:

alias renew="sudo ipconfig set en0 BOOTP && sudo ipconfig set en0 DHCP"

So then you just have one command called renew that will release and renew your DHCP.

share|improve this answer
Rob's answer will certainly work - but ipconfig set always first de-configures the interface before setting up DHCP again. I've never needed the first command - and ipconfig is much more high level (it handles routes better) than ifconfig and I prefer it for the case you state. – bmike Jul 14 '11 at 3:21
The cli command "ipconfig set en0 DHCP" is not a dhcp-renew in the pure sense but a complete discover,offer,request,ack procedure. The "renew" button on the control pane just generates a dhcp-request (preceded by a release) and is answered by an ACK. There is a difference between both as renew is typically sent by a cpe at half the lease time to renew to lease before it expires. Internet access-devices like a cable modem termination system will react differently on both procedure. So I'm still looking for a pure dhcp-renew command – user37314 Dec 26 '12 at 14:03

The way the Renew button works in System Preferences is to create a key in the System Configuration. One can create the key via:

echo "add State:/Network/Interface/en0/RefreshConfiguration temporary" | sudo scutil

swapping en0 for the desired interface.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.