Command line tip: How to restart Mac OS X networking

Apple LogoIf you’re a terminal warrior like me, you’ll occasionally need to reboot the OS X network interface. There’s a quick way to do this through the command line – but first you need to know the identity of your network interface.

Run the ifconfig command in your terminal and find the interface with an IP address attached to it. On my MacBook Pro, the ethernet interface is en0 while the wireless interface is en1.  Yours may be similar.

Shutting down the network interface

Now that you’ve identified the interface, shutting it down and restarting it is a breeze. Run this command:

sudo ifconfig en0 down

And to start things back up again…

sudo ifconfig en0 up

That’s it. It’s a simple command that’s worth remembering – or bookmarking!

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