Does macOS provide any command line control over external wifi antennas connected through USB as 11ac adapters?

I know that I can connect to any wifi network from command line using the command line utility `/usr/sbin/networksetup` like this:


/usr/sbin/networksetup -setairportnetwork en0 <SSID> <PASSWORD>


Above works perfectly well. I can also switch wifi off and on using `/usr/sbin/networksetup` from command line. This is great.


There is another utility that is `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport` to do similar things as I figured out.


But, I have a external wifi antenna connected to my macOS machine through USB C port. It lists itself as a 11ac adapter under System Preferences > Network. Under `ifconfig`, it enlists as below


en10: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 78:32:1b:05:eb:11
        inet6 fe80::86d:55fc:c8ae:f9e1%en10 prefixlen 64 secured scopeid 0x9
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect
        status: active


It works just like the built in wifi antenna and it enlists the SSIDs like default macOS Network Preferences SSIDs list. But `/usr/sbin/networksetup -setairportnetwork en0 <SSID> <PASSWORD>` does not make the antenna connect to the desired SSID.


How can I programatically make this external antenna connect to a specific SSID? Is it possible? Does macOS give any command line control over wifi antennas connected as 11ac adapters?



Posted on Oct 2, 2019 6:57 AM

Reply

Similar questions

9 replies

Oct 3, 2019 5:59 AM in response to SamPiHee

But the device name is en10, why do you think that you can talk device en10 by addressing en0?


If you want to visit someone in apartment 10 do you knock on the door of apartment 0 ???


And en10 does not sound like an antenna, but rather a WiFi device of its own. So it is its own network interface.


The build-in WiFi radio is going to be higher in the service order list, so if the built-in WiFi radio is connected to a WiFi base station it will be used over the 3rd party device. If the built-in WiFi radio is not connected, then if your 3rd party radio is the only one with a working network connection, the Mac will select that as the default networking route.

Oct 3, 2019 6:35 AM in response to ada166

If it shows up as an interface is it more than just an antenna. It is an entire WiFi radio.


Did you get errors, or is it that the Mac kept using the en0 interface? If errors what were they?


By default the Mac will just use 1 networking interface even if there are 2 or more active. You can make sure the other network interfaces are not connected, or you can turn off the other active network interfaces, or you can play with the System Preferences -> Network -> Set Service Order via the interface gear menu.

Oct 3, 2019 6:49 AM in response to BobHarris

Running `/usr/sbin/networksetup -setairportnetwork en10 <SSID> <PASSWORD>` gives the following error.


en10 is not a Wi-Fi interface.

** Error: Error obtaining wireless information.


I did a `/usr/sbin/networksetup -listnetworkserviceorder` and en10 listed up at number 15 as the following:


    (15) 11ac adapter
    (Hardware Port: 11ac adapter, Device: en10)

But after following suggestion of `System Preferences -> Network -> Set Service Order` it is now put at number 1:


    (1) 11ac adapter
    (Hardware Port: 11ac adapter, Device: en10)

But it still complains that "en10 is not a Wi-Fi interface".


Besides, yes it is a whole different wifi radio with its own driver installed on my mac and an application which shows the reachable networks just like the networks list show on Mac.

Oct 2, 2019 5:37 PM in response to ada166

I was talking about

It works just like the built in wifi antenna and it enlists the SSIDs
like default macOS Network Preferences SSIDs list. But
`/usr/sbin/networksetup -setairportnetwork en0 <SSID> <PASSWORD>` 
does not make the antenna connect to the desired SSID.

from your post. Was it a typo that you say this networksetup doesn't work, as you say en0 here, when your ifconfig says the external is en10

Oct 2, 2019 11:42 PM in response to BobHarris

Oh. I meant that using the command /usr/sbin/networksetup -setairportnetwork en0 <SSID> <PASSWORD>, I can change the default wifi connection which lists under top right corner SSIDs list. en0 is default wifi interface on my mac. Thats okay.


But I have a separate antenna connected to my mac through USB. This has its own driver and its own list of SSIDs to connect to. It acts like whole different application which is able to make my mac connect to any wifi network. And it lists under ifconfig as en10. I have a hopeless hope that I might be able to control it and make it connect to a wifi network from command line as well? Using /usr/sbin/networksetup -setairportnetwork en0 <SSID> <PASSWORD> ? But not possible is it?

Oct 3, 2019 6:08 AM in response to BobHarris

No. You are misunderstanding @Bob. I am not trying it on en0. That was only a way to show that en0 works in normal case "without" the antenna in play.


When I connect the external antenna, I see that en10 is the new/extra interface that gets mounted. So, I tried doing a /usr/sbin/networksetup -setairportnetwork en10 <SSID> <PASSWORD> which did not work. Hence trying to look for some help from the experts in this forum here.


The antenna has its own driver and own application but it does not change network when I try to control it using /usr/sbin/networksetup on en10.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Does macOS provide any command line control over external wifi antennas connected through USB as 11ac adapters?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.