UPDATE: Thanks to Patrick Fergus’s feedback I’ve updated the script to use “defaults delete” rather then “rm -f”. This addresses the potential of the deleting not working due to how cfprefsd works on 10.9 and up systems.
This script is a quick way to wipe out the network settings on a Mac. Maybe your computer just isn’t working right on wireless or the wired network, or you want to start fresh or maybe your doing spring cleaning. Whatever the reason, just remember that all network settings (including wireless settings) will be removed. Things like the networks you’ve used, wireless network passwords, static IP settings, etc. will all be gone and you will have to reconfigure all that again.
Just turn off your wireless interface then run the following commands. Enjoy.
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/preferences.plist
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/com.apple.network.eapolclient.configuration.plist
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/com.apple.eapolclient.plist
sudo /usr/bin/defaults delete /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
Interested In A Free Installer?
Our custom Wifi On/Off script has been a popular post!
This script automatically turns off the wireless interface on a computer when it is connected to a wired network, and turn the wireless interface back on when it is disconnected from the wired network.
This script has two main benefits:
- Network connection failover
- Eliminates unnecessary wireless traffic, and Multi-homed computers.