Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Occasionally it's nice to hard code a wired connection network port to not auto negotiate and force things to be 100 half duplex even though a higher speed is configured and negotiable on the switch.

Can I similarly force airport software and thus the hardware to only run one flavor of 802.11? Can I use the airport command to prefer a higher / lower channel rather than join by signal strength? Might alternative drivers be available or some developer testing tool to exert this level of control over the WiFi chipsets in Macs.

I want to force this on the mac end for cases where I can't control the base stations or want to test a specific channel of a simultaneous dual band router that is live with other traffic.

mac:bin mike$ airport --scan
                            SSID BSSID             RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
                     na ala hele 00:26:36:9c:32:23 -59  2       Y  US WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
                     na ala hele 00:26:bb:79:23:1f -59  2       Y  US WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
                fast na ala hele 00:26:bb:79:23:20 -74  149,+1  Y  US WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
mac:bin mike$ airport --getinfo
     agrCtlRSSI: -75
     agrExtRSSI: 0
    agrCtlNoise: -86
    agrExtNoise: 0
          state: running
        op mode: station 
     lastTxRate: 81
        maxRate: 300
lastAssocStatus: 0
    802.11 auth: open
      link auth: wpa2-psk
          BSSID: 00:26:bb:79:23:20
           SSID: fast na ala hele
            MCS: 4
        channel: 149,1
mac:bin mike$ ls -l /usr/local/bin/airport 
lrwxr-xr-x  1 root  wheel  89 Sep 13 11:40 /usr/local/bin/airport -> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
share|improve this question
add comment

5 Answers

Maybe this help, you can access to the airport command utility with

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport

Then, type

sudo airport en1 prefs JoinMode=Strongest JoinModeFallback=KeepLooking

JoinMode = Ranked and JoinModeFallback = Prompt are the defaults, if you want to switch back

share|improve this answer
    
Thanks! I'll keep this in mind - I wasn't aware of this tidbit and perhaps can exploit it in an indirect manner by getting as close to the network I prefer. It clearly won't work for dual band routers... I can't always depend on the channel I want to force my hardware being the strongest signal, but you've got me one step closer to a good solution. –  bmike Sep 9 '11 at 23:22
    
I'm choosing this for the bounty as I've already got /System/Library/CoreServices/Wi-Fi Diagnostics for the pretty graphs and frame debugging. The airport command is the tool that would be able to set the radio - but it's documentation is lacking and it appears to be in transition to a new format. Thanks to all who answered. –  bmike Sep 15 '11 at 17:08
1  
What exactly is JoinMode=Ranked? It is documented anywhere quasi-offically? –  bmike Jul 30 '12 at 17:34
add comment

If you just want to check whether the base station is sending on the right channel, Kismac may be of use to you. This will show all modes that your Airport card supports, including dual-band base stations. It's also great for checking wi-fi coverage with the built-in signal monitor, which can chart signal strength as you walk around with laptop in hand.

Overview

Signal chart

share|improve this answer
    
Very nice link - I'll keep that in mind if I need more details. airport --getinfo and airport --scan currently work for my needs. Does Kismac do more than just interpreting the airport scan data that I can see from the command line? –  bmike Sep 13 '11 at 16:44
    
Yes, much more, including some common WEP attacks. There's a feature list. –  Ingmar Hupp Sep 13 '11 at 17:27
    
Wow - this is really a great tool. It's not what I need now - but I'll certainly give it a try in the future. –  bmike Sep 15 '11 at 17:04
add comment

From my understanding, I think this is only possible at the router level. So that router's will only accept "X" traffic, and not at the broadcast level (your NIC). I suppose you could use ipfw to throttle bandwidth on certain machines, to do, um, your testing ;)

share|improve this answer
1  
I am really looking to get at the radio on the mac. This would allow me to ignore all the b/g clutter if I want to see the one or two 802.11a routers. Also, for interference testing, I want to know I'm measuring the n band and not have my mac hop to a lower channel - I need it to fail when it's pinned to one channel for the testing to be accurate. –  bmike Sep 2 '11 at 15:07
    
Also the Network Link Conditioner is great alternative to ipfw for light <strike>pranking</strike> testing. –  bmike Sep 15 '11 at 17:10
1  
Might you have any insight into this other question, cksum? apple.stackexchange.com/questions/38125/… - that OP is looking to hack at the guts of airport cards too –  bmike Feb 8 '12 at 16:40
add comment

With the Wireless Diagnostic that Apple introduced in 10.8.4 - I now have the beginnings of a workable answer.

Running the tool (which is in /System/Library/Core Services) by option clicking the Airport icon in the menu bar - I can capture arbitrary frames on any allowable channel (but not actually join a base station on this specified channel or radio mode). This saves a standard tcpdump file that can be analyzed. The Info tab in the Utilities window and the associated tools for Logging, Frame Capture, Wi-Fi Scan and Performance allow me to troubleshoot most wireless situations.

I have also added an Aerohive AP121 router to my toolset and that allows near real time FFT graphical spectrum analysis of tricky radio situations, but that's a bit of overkill for wanting an OS X tool to begin to tease apart challenging wireless environments.

share|improve this answer
add comment

From your original question : Can a Mac's airport card run 802.11 N, G, B or A only?

I found this article that might answer your question.

It points to using Ifconfig to set the specific 820.11 protocol..

Since the article is long I will only post a sample.

This example will force the card to operate in 802.11g (of course there is more to it, do not want to clutter here).

wlans_ath0="wlan0"

ifconfig_wlan0="mode 11g ssid your_ssid_here DHCP"

share|improve this answer
    
The mode argument isn't accepted by standard ifconfig on MacOS X 10.6 & 10.7. Did you manage it to work? How? –  daniel Azuelos Jul 8 '13 at 22:36
    
the example was for Atheros driver ! (ath0) –  Buscar 웃 Jul 9 '13 at 2:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.