Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this MacBook Pro that has intermittent problems connecting to my WiFi network. Sometimes it helps to disable/re-enable Airport and sometimes I have to restart the computer to get my network running again.

Has anyone else experienced this? Are there any commands I can run that would do the same as I do when I restart the computer (short of actually restarting it, obviously) - or at least a command that restarts the Airport service?

share|improve this question

3 Answers

up vote 3 down vote accepted

Next time, try this from the command line:

sudo ifconfig en1 down
sudo ifconfig en1 up

This should bring your wireless interface down and then bring it back up.

share|improve this answer
networksetup -setairportpower en1 off
networksetup -setairportpower en1 on

These are the commands I use to control Airport without the menubar icon. The advantage is that they don't require su/sudo privileges.

share|improve this answer
d=$(networksetup -listallhardwareports | egrep 'AirPort|Wi-Fi' -A1 | grep -o en.)
[[ "$(networksetup -getairportpower $d)" == *On ]] && val=off || val=on
networksetup -setairportpower $d $val

The device name is en0 on MacBook Airs. The port name was changed from AirPort to Wi-Fi in 10.7.

share|improve this answer

Your Answer

 
discard

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.