Add wireless network (using certs) via CLI

Joined
Sep 19, 2013
Messages
2
Reaction score
0
Points
1
Hi,
I'm trying to switch my network over to certificate based authentication on wireless. Everything works fine when you manually add the wireless network and choose which certificate you want to use to authenticate. However, I need to script this process and do it via CLI. I can't figure out how to make that happen.

The networksetup command man page says this:
Code:
-addpreferredwirelessnetworkatindex hardwareport network index securitytype [password]
             Add wireless network named <network> to preferred list for <hardwareport> at <index>. Store the
             optional password in the keychain For security type, use OPEN for none, WPA for WPA Personal,
             WPAE for WPA Enterprise, WPA2 for WPA2 Personal, WPA2E for WPA2 Enterprise, WEP for plain WEP,
             and 8021XWEP for 802.1X WEP.


However, my network uses 802.1x with WPA2, not WEP. This is verified by the airport command:
Code:
me$ ./airport -s | egrep "ban|SSID"
                            SSID BSSID             RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
                   banannananana 08:cc:68:91:37:8f -49  36      Y  US WPA2(802.1x/AES/AES)

Anyone know how I can select a certificate from the keychain? Or even prompting the user to select a cert as soon as the command is entered would suffice. I was thinking that maybe when I manually add the network, it might create the .config file which is used for 802.1x, but I can't find where that's at either. Any help would be great. Thanks!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top