Renew IP address on Mac OSX using the command line

I’m still discovering things with the Macbook – particularly the differences between OSX and Windows.

One thing that’s happened a couple of times now is that I’ll start my Mac from a sleep state and it reports that another device has the same IP address as it had previously been assigned.

As every device I use is connected via Wireless including the Macbook, first thing I did was go to the Airport Network Preferences, disconnect Airport then reconnect. After that didn’t work I removed my wireless config from Airport then added it again – still with no luck.

With Windows it’s pretty simple – open a command prompt and type ‘

ipconfig /release

then

ipconfig /renew

….but OSX has a different trick.

One article suggested I open a command prompt (in OSX) and type

sudo ifconfig en0 down
sudo ifconfig en0 up

This resolved the issue. However my noggin told me this would be weird as in theory en0 should be the ethernet port and en1 the wireless. Sure enough, doing a

netstat -i

proved this to be the case. So whilst I resolved the issue, I’m a bit puzzled why releasing the ethernet adaptor would help resolve this… if anyone knows please comment!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s