A customer called asking if I could disable WiFi for some of his new iMacs at the office. He wanted his users to connect via Ethernet cable. After digging around I found a way to manage WiFi using macos Terminal.

There are a few simple steps you can take. First, a great cup of coffee!

Then, open your macOS Terminal.

First you need to find the network interface name by running the following command:

networksetup -listallhardwareports
Manage WiFi using macOS Terminal
Manage WiFi using macOS Terminal

This Terminal command gives you a nice layout of all your network interfaces.

After you find the network interface for your WiFi you can turn it off by running:

networksetup - setairportpower en0 off

Let’s say you changed your mind and you want to turn back ON your WiFi using the Terminal you run:

networksetup - setairportpower en0 on

For example, if you like to join a different WiFi network you can run the following command in the Terminal to view available networks:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport scan

To join one of those WiFi networks you found:

networksetup -setairportnetwork en0 SSID_YOU_WANT_TO_JOIN WIFI_PASS

There’s a space between SSID_YOU_WANT_TO_JOIN and WIFI_PASS.

I’m not sure why Apple doesn’t like to publish much documentation about running these task to make IT handy man lives easier. Anyways, hope this post helps someone out there.

Remember to check my IT coffee mugs and T-Shirt shop. I make my own designs. You can also contact me if you have any questions.

Leave a comment

Your email address will not be published. Required fields are marked *