The Lumber Room

"Consign them to dust and damp by way of preserving them"

Restarting Airport from the command line

leave a comment »

Something is wrong with the network in my dorm; DHCP negotiation sometimes fails (or takes a long time). So the usual thing to do is to turn Airport off and on, and hope it works this time.

To do this from the commandline, here’s a simple trick I found:
Go to System Preferences → Network, then in Location choose a New Location and create one called “Airport-Off” (or anything you like). In the Show menu choose Network Port Configurations and turn off Airport.

After this, you can do scselect Airport-Off to turn it off, and scselect 0 (for Automatic — or choose whatever other location you want) to turn it on.

Edit [2011-10-03]: You can also do this:

sudo networksetup -setairportpower "Airport" off
sudo networksetup -setairportpower "Airport" on

Written by S

Mon, 2007-10-08 at 01:51:44

Posted in compknow

Tagged with , , , , , ,

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