The Lumber Room

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

Posts Tagged ‘airport

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 PreferencesNetwork, 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 , , , , , ,