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

I recently used ifconfig en1 to set the IP address of a network interface (specifically, the wireless card) on a Mac… How can I remove/unset it?

Using the graphical network configuration tool doesn't seem to change (or even be aware of) this address - when I use it to manually set an address, a second address is added to the device.

For example, right now ifconfig shows:

    ether 00:23:xx:xx:xx:xx 
    inet netmask 0xffffff00 broadcast
    inet netmask 0xffffff00 broadcast
    media: autoselect
    status: active

The first address - 141.99 - is the address I manually set. The second address — 1.112 — is the address assigned by my network's DHCP server.

share|improve this question

migrated from Sep 24 '11 at 16:55

This question came from our site for system and network administrators.

up vote 9 down vote accepted

Use delete:

ifconfig en1 delete
share|improve this answer
This didn't work for me, I had to do ifconfig en1 del on Ubuntu. Hope it helps someone. – Frodik Aug 21 '15 at 13:26

I believe a reboot should reset it.

share|improve this answer
That might. But I'd rather leave it than sit through a reboot :P – David Wolever Sep 25 '11 at 2:07

Sounds like you are looking to change the device en1 from 'static' to 'dhcp'. To do this perform the following:

sudo ifconfig set en1 BOOTP
sudo ifconfig set en1 DHCP

After making the config changes you will need to bring that interface down and back up:

sudo ifconfig en1 down
sudo ifconfig en1 up
share|improve this answer
Which version of ifconfig uses that syntax? The manpage for ifconfig on my machine (10.6.7) mentions nothing of either a set action or dhcp. – David Wolever Sep 25 '11 at 2:07


sudo ifconfig en1 down
sudo ifconfig en1 up
share|improve this answer
Sorry, but this doesn't work — the address persists past the down/up. – David Wolever Sep 24 '11 at 18:37
Did you ifconfig en1 back to your original address? If you didn't then it's obviously going to be the same one you had changed it to. – l'L'l Sep 24 '11 at 19:49
Sorry, my original question wasn't as clear as it could be. There was no “original address” - normally I have addresses assigned via DHCP, which now adds a second address to the interface. – David Wolever Sep 25 '11 at 2:08

To clear all ip address associated with en1: sudo ifconfig en1

share|improve this answer

Try :

ifconfig en* down detach delete 
share|improve this answer
Please could you expand this answer to explain what the various flags and options are doing? – Graham Miln Feb 11 '14 at 7:44
and why does this work and other answers do not? – Mark Feb 11 '14 at 11:42

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.