12

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

4 Answers 4

8
+50

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

4
  • 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
    Commented Sep 9, 2011 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
    Commented Sep 15, 2011 at 17:08
  • 2
    What exactly is JoinMode=Ranked? It is documented anywhere quasi-offically?
    – bmike
    Commented Jul 30, 2012 at 17:34
  • why sudo? Network joining should be available for the regular user, right? Commented Jun 23, 2014 at 7:04
4
+100

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

3
  • 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
    Commented Sep 13, 2011 at 16:44
  • Yes, much more, including some common WEP attacks. There's a feature list. Commented Sep 13, 2011 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
    Commented Sep 15, 2011 at 17:04
0

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 ;)

3
  • 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
    Commented Sep 2, 2011 at 15:07
  • Also the Network Link Conditioner is great alternative to ipfw for light <strike>pranking</strike> testing.
    – bmike
    Commented Sep 15, 2011 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
    Commented Feb 8, 2012 at 16:40
0

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.

No answer seems to let me control the OS X / radio software stack to force a connection or operation on one of the frequency bands, though so the answer seems to be no at the moment (as well as for quite some time).

1
  • bmike I'm also looking to do the same thing. Did you ever find a solution?
    – cavalcade
    Commented Mar 28, 2016 at 2:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .