Jesus Vigo reviews Terminal commands used to enable, modify, and manage Wi-Fi connections on Macs in OS X.
Image: Jesus Vigo |
For those leveraging mobile device management (MDM) platforms to push settings, this is a non-issue, but if the cost of these suites remains prohibitive or connectivity is spotty, the following Terminal commands can be used to manage Wi-Fi settings in OS X. They can even be incorporated into a script and deployed to remote end users.
Before moving forward with the various networksetup-based commands, please note that as of OS X 10.8, the AirPort Terminal command, which is what drives some of the changes made to Apple's AirPort wireless connections, has been hidden within the OS and must be referenced directly each time the command is run. To side-step this, run the command below first, which will create a symbolic link to the AirPort command itself so that it may be referenced each time without having to enter a long string of commands each time.
- Create a symlink to the AirPort command in Terminal
ln -s /System/Library/PrivateFrameworks/Apple80211.framework/ Versions/Current/Resources/airport /Usr/bin/airport
- Network connections list
networksetup -listallhardwareports
- Enable or Disable Wi-Fi
networksetup -setairportpower en0 on (or off)
- Secure Wi-Fi Settings
airport prefs RequireAdminIBSS=YES RequireAdminPowerToggle=YES RequireAdminNetworkChange=YES
Arguments
RequireAdminsIBSS=yes (or no) | Restricts creation of ad-hoc networks to admins.RequireAdminPowerToggle=yes (or no) | Restricts power on/off of Wi-Fi to admins.
RequireAdminNetworkChange=yes (or no) | Restricts network changes to admins.
- View available Wi-Fi networks
airport -s
- Join Wi-Fi network
networksetup -setairportnetwork en0 SSID_OF_WIRELESS_NETWORK WIRELESS_NETWORK_PASSPHRASE
- Create a Wi-Fi network profile
networksetup -addpreferredwirelessnetworkatindex en0 SSID_OF_NETWORK INDEX_NUMBER SECURITY_OF_WIRELESS_NETWORK WIRELESS_NETWORK_PASSPHRASE
INDEX_NUMBER | Numerical value to assigns a position in the list of preferred wireless networks. A value of "0" adds to the network to the top of the list.
SECURITY_OF_WIRELESS_NETWORK | Wireless network security type (ex.) WPA2.
WIRELESS_NETWORK_PASSPHRASE | Password or passphrase used to authenticate the password-protected network.
- Delete a Wi-Fi network profile
networksetup -removepreferredwirelessnetwork en0 SSID_OF_NETWORK
- Remove all stored Wi-Fi network profiles
networksetup -removeallpreferredwirelessnetworks en0
How do you manage Wi-Fi for Macs in your organization? Share your experience in the discussion thread below.
~ Jesus Vigo
0 comments:
Post a Comment