Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: Add wireless networks from command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Add wireless networks from command line
Authored by: tom larkin on Oct 06, '10 07:33:58AM

Darthmangus-

You may want to look at the airport framework. It may help you with your issue.

look here:

bash-3.2# /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -h
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport AirPort v.528.1 (528.1.0)
Supported arguments:
 -z        --disassociate       Disassociate from any network
 -i[] --ibss=[]       Create IBSS
 -x        --xml                Print info as XML
 -s[] --scan=[]       Perform a wireless broadcast scan.
				   Will perform a directed scan if the optional  is provided
 -r   --repeats=      Repeat the command the specified number of times
 -A[] --associate=[]  Associate to network.
				   Will prompt for network name if arg is not specified
				   and if necessary, for a password if the network is using WEP or WPA.
				   The following additional arguments may be specified with this command:
                                  --bssid=     Specify BSSID to associate with
                                  --password=  Specify a WEP key or WPA password
 -I        --getinfo            Print current wireless status, e.g. signal info, BSSID, port type etc.
 -P   --psk=          Create PSK from specified pass phrase and SSID.
				   The following additional arguments must be specified with this command:
                                  --ssid=      Specify SSID when creating a PSK
 -c[] --channel=[]    Set arbitrary channel on the card
 -h        --help               Show this help



[ Reply to This | # ]
10.6: Add wireless networks from command line
Authored by: DarthMagnus on Oct 06, '10 09:46:04AM

I have looked at the airport framework, the security command, and the networksetup command, and unfortunately, none of them seem to allow me to select an 802.1x profile to use for the network. I could leave it to automatically decide, but we've found that it doesn't always work. It will choose some MobileMe certificate or other "trusted" cert over the existing 802.1x profile. All in all it seems to be fairly buggy, if you ask me.

In my searching I was able to find a post by "Big Mac on Campus" who works at Clemson, who produced a somewhat similar solution, but it's quite a bit larger than I would have expected or liked it to be, and it uses PEAP authentication, not TLS, so he doesn't address the certificate issue. He also goes about solving problems by directly editing the .plist files.

http://bigmaconcampus.wordpress.com/2009/08/27/wireless-installer-the-next-generation/

All in all I was hoping for a much simpler solution, as it will take quite a bit more work to go through the code for this other solution and tweak it to my needs. But unfortunately, it seems like there just isn't one out there.



[ Reply to This | # ]
10.6: Add wireless networks from command line
Authored by: dzurn on Feb 02, '12 12:28:17PM
Sorry to dredge up an old thread, but I was just looking for a way to set up an Airport network automatically and found this on ol' reliable MacOSXHints.com!

I found that networksetup includes a command to import a profile. From man networksetup:

     -import8021xProfiles service path
             Imports the 802.1x profiles for the specified service.

Now I'm just trying to figure out how to specify 128-bit WEP, and name the network and password. ;)

---
Madness takes its toll.
Please have exact change.


[ Reply to This | # ]