Apple - Wifi doesn't work unless I turn it off then on again

Old preferences hanging around after upgrade can cause issues. To force a rebuild of the preferences open Terminal and do:

cd /Library/Preferences/SystemConfiguration
sudo rm NetworkInterfaces.plist
sudo rm com.apple.airport.preferences.plist
sudo rm preferences.plist

then restart your machine.


What actually helped was to reset the SMC and reset the PRAM. Now the Mac connects instantly to the WiFi.

Later edit: It looks like the problem is caused by interference from Bluetooth signals and your WiFi device. Because it connected much faster with Bluetooth off. I changed to a 5Ghz network on another WiFi AP and I had no problems since.

The following are all suggestions I've tried from different sources:

  • moving preferred network to top
  • clearing all WiFi passwords (including those from the keychain) and reconnecting only to the preferred network
  • disabling bluetooth
  • forcefully removing network configuration files
  • adding a fixed DNS server

Try this Golang script out - https://github.com/icecrasher321/Wifi_Hack

The script automates the process of turning off and on your wifi at intervals of 20 minutes(Future versions will detect packet drops to start the wifi reset process). You can keep it running in the background. More information is available in the README of the github link given above.

If you don't want to install Golang just for this, you can get the same result by using the following shell script

#!/bin/bash

while :; do
    networksetup -setairportpower en1 off
    sleep 3
    networksetup -setairportpower en1 on
    sleep $((20 * 60))
done

Run networksetup -listallhardwareports first to check whether your Wi-Fi really is on en1 .