airport

WiFi monitoring

No man page
revised 12/18/22 as per 12.6.2 Montery

    airport [interface ] [-Ixh] [-P --password=ppp --aaa]] [verb] [prefKeyword [={YES|NO|value}]

If interface is not specified, uses the first AirPort interface on the system.
If nonexistant interface is specified (example en1) NO error message is displayed, help is displayed.

prefs
If specified with no key value pairs, displays a subset of preferences for the specified interface.
> airport prefs   
AirPort preferences for en0:

DisconnectOnLogout=NO
Unable to retrieve JoinMode
JoinModeFallback=Prompt
RememberRecentNetworks=YES
RequireAdminIBSS=NO
RequireAdminNetworkChange=NO
RequireAdminPowerToggle=NO
AllowLegacyNetworks=YES
WoWEnabled=YES 
Preferences are configured using key=value syntax.
 DisconnectOnLogout =YES|NO
 JoinMode = Automatic Preferred Ranked Recent Strongest
 JoinModeFallback = Prompt JoinOpen KeepLooking DoNothing
 RememberRecentNetworks =YES|NO
 AllowLegacyNetworks =YES|NO
 WoWEnabled =YES|NO
 RequireAdmin =YES|NO        RequireAdminIBSS =YES|NO    RequireAdminNetworkChange =YES|NO       RequireAdminPowerToggle =YES|NO
logger
Monitor the driver's logging facility.
sniff
If a channel number is specified, airportd will attempt to configure the interface to use that channel before it begins sniffing 802.11 frames. Captures files are saved to /tmp. Requires super user privileges.
debug
Enable debug logging, a setting is enabled by prefixing it with a '+', and disabled by prefixing it with a '-'.

Userland Debug Flags
DriverDiscovery         DriverEvent         Info        SystemConfiguration
UserEvent               PreferredNetworks   AutoJoin    IPC
Scan                    802.1x              Assoc       Keychain
RSNAuth                 WoW                 P2P         Roam
BTCoex
+AllUserland  Enable/Disable all userland debug flags
Driver Common Flags
DriverInfo         DriverError         DriverWPA       DriverScan
+AllDriver  Enable/Disable all driver debug flags
Driver Vendor Flags
VendorAssoc     VendorConnection
+AllVendor  Enable/Disable all vendor debug flags
logfile
+LogFile > Save all AirPort logs to /var/log/wifi.log

-I
--getinfo
     agrCtlRSSI: -64
     agrExtRSSI: 0
    agrCtlNoise: -90
    agrExtNoise: 0
          state: running
        op mode: station 
     lastTxRate: 65
        maxRate: 144
lastAssocStatus: 0
    802.11 auth: open
      link auth: wpa2-psk
          BSSID: 0:7f:28:cc:a9:f4
           SSID: disabled
            MCS: 7
        channel: 6
-s nds
      th/unicast/group)
Totaro-2.4 dc:fe:07:af:73:28 -89  11      Y  US WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
     XPB74 70:f1:96:17:8e:87 -89  6       Y  US WPA(PSK/AES/AES) WPA2(PSK/AES/AES) 
     BW52K 00:26:b8:a1:ee:fc -85  6       Y  US WEP
     FEHV1 00:26:62:ee:0a:14 -87  6       N  US WEP
 T4MP4_EXT c0:ff:d4:ca:15:df -83  6       Y  US WPA2(PSK/AES/AES) 
  disabled 00:7f:28:cc:a9:f4 -64  6       Y  US WPA(PSK/AES/AES) WPA2(PSK/AES/AES) 
-c[chan]
--channel=[chan]
> airport en0 --channel 11
channel: 100,80
-z
--disassociate
 
-s[arg]
-P
--psk
Create PSK from pass phrase and SSID. arguments must be specified:
--password=password WPA password
--ssid ssiidd
-x
--xml
output info as XML
-h
--help
 


verb
prefs with no key value pairs:
DisconnectOnLogout=NO
Unable to retrieve JoinMode
JoinModeFallback=Prompt
RememberRecentNetworks=YES
RequireAdminIBSS=NO
RequireAdminNetworkChange=NO
RequireAdminPowerToggle=NO
WoWEnabled=NO
Preferences are configured using key=value .
In addition to above:
JoinMode: Automatic    Preferred    Ranked    Recent    Strongest
JoinModeFallback: Prompt    JoinOpen    KeepLooking    DoNothing
RequireAdmin: Yes No
logger Monitor the driver's logging facility.
sniff chan Capture file are saved to /tmp/airportSniffxxxxx.cap.: Requires root and cap decodder.
debug [-] [flags] Enable/Disable debug logging. Enabled by prefixing with +, disabled with - .

Adding enough flags can cause an overwhelming about of logging to /var/log/wifi.log

AirPort Userland Debug Flags DriverDiscovery, DriverEvent, Info, SystemConfiguration, UserEvent, PreferredNetworks, AutoJoin, IPC, Scan, 802.1x, Assoc, Keychain, RSNAuth, WoW, P2P, Roam, BTCoex
AllUserland Enable/Disable all userland debug flags DriverInfo, DriverError, DriverWPA, DriverScan, AllDriver - Enable/Disable all driver debug flags
AirPort Driver Vendor Flags VendorAssoc, VendorConnection, AllVendor - Enable/Disable all vendor debug flags
AirPort Global Flags LogFile Save to /var/log/wifi.log

From .log, edited for clarity.

 17:10:54.591 Info: <airport[pid]> TRIMMED QUERY SCAN CACHE request received from pid 501 (WiFiAgent)
17:10:54.596 Info: <airport[pid]> QUERY GAS CACHE request received from pid 501 (WiFiAgent)
17:10:54.597 Info: <airport[pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)
17:10:54.609 Info: <airport[pid]> GET CURRENT TETHER DEVICE request received from pid 501 (WiFiAgent)
17:10:54.610 Info: <airport[pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)
17:10:54.621 Info: <airport[pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)

17:11:28.912 AutoJoin: <airport[pid]> BACKGROUND SCAN request on interface en0 with SSID list (null)

17:11:28.914 Scan: <airport[pid]> Cache-assisted scan request on channel 1 does not require a live scan
17:11:28.914 Scan: <airport[pid]> Cache-assisted scan request on channel 2 does not require a live scan
 3 does not require a live scan
does not require a live scan
17:11:28.914 AutoJoin: <airport[pid]> Successful cache-assisted background scan request with channels {(
                CWChannel                 width
17:11:28.914      767a0> [1(2GHz), 20MHz, active],
17:11:28.914      5b9d0> [2(2GHz), 20MHz, active],
17:11:28.914      66960> [3(2GHz), 20MHz, active]
17:11:28.914 ) took 0.0007 seconds, returned 3 results

 4 does not require a live scan 5 6 
17:11:28.914      76cc0> [4(2GHz), 20MHz, active],
17:11:28.914      10ee0> [5(2GHz), 20MHz, active],
17:11:28.914      10960> [6(2GHz), 20MHz, active]

… continued for channel 7,8,9  10,11 36, thru
             but with  slowing wifi intensity. every set has one (or 2)    null does not require a live scan.

17:11:28.915      76b90> [7(2GHz), 20MHz, active],
17:11:28.915      5e600> [8(2GHz), 20MHz, active],
17:11:28.915      5e230> [9(2GHz), 20MHz, active]

 10 does not require a live scan 11 36 
does not require a live scan
does not require a live scan
17:11:28.915      5e360> [10(2GHz), 20MHz, active],
17:11:28.915      77110> [11(2GHz), 20MHz, active],
17:11:28.915      66cc0> [36(5GHz), 40MHz(+1), active]

 40 does not require a live scan 44 48 
17:11:28.915      100a0> [40(5GHz), 40MHz(-1), active],
17:11:28.915      0a7a0> [44(5GHz), 40MHz(+1), active],
17:11:28.915      0f620> [48(5GHz), 40MHz(-1), active]

17:11:28.916      18ec0> [149(5GHz), 20MHz, active],
17:11:28.916      48350> [153(5GHz), 40MHz(-1), active],
17:11:28.916      5f370> [157(5GHz), 40MHz(+1), active]

 161 does not require a live scan 165 12 
17:11:28.916      67b40> [161(5GHz), 40MHz(-1), active],
17:11:28.916      4be10> [165(5GHz), 20MHz, active],
17:11:28.916      1fbc0> [12(2GHz), 20MHz]

 13 does not require a live scan 52 56 
17:11:28.916      569d0> [13(2GHz), 20MHz],
17:11:28.916      569d0> [13(2GHz), 20MHz],
17:11:28.916      461b0> [52(5GHz), 40MHz(+1), DFS],

 60 does not require a live scan 64 100 
17:11:28.916      47280> [60(5GHz), 40MHz(+1), DFS],
17:11:28.916      57290> [64(5GHz), 40MHz(-1), DFS],
17:11:28.916      76a70> [100(5GHz), 40MHz(+1), DFS]

 104 does not require a live scan 108 112 
does not require a live scan
17:11:28.916      1a4d0> [104(5GHz), 40MHz(-1), DFS],
17:11:28.916      4bf40> [108(5GHz), 40MHz(+1), DFS],
17:11:28.917      52620> [112(5GHz), 40MHz(-1), DFS]
 116 does not require a live scan 120 124 
17:11:28.917      477c0> [116(5GHz), 40MHz(+1), DFS],
17:11:28.917      4bd10> [120(5GHz), 40MHz(-1), DFS],
17:11:28.917      65df0> [124(5GHz), 20MHz,     DFS]
 128 does not require a live scan 132 136 
17:11:28.917      5aff0> [128(5GHz), 40MHz(-1), DFS],
17:11:28.917      658b0> [132(5GHz), 20MHz,     DFS],
17:11:28.917      15d50> [136(5GHz), 40MHz(-1), DFS]
17:11:28.917      15d50> [136(5GHz), 40MHz(-1), DFS]
 140 does not require a live scan 144 
17:11:28.917      1a400> [140(5GHz), 20MHz,     DFS],
17:11:28.917      68350> [144(5GHz), 40MHz(-1), DFS]

17:11:37.922  en0: Received EAPOL packet (length = 145)
17:11:37.922  inputEAPOLFrame: 0 extra bytes present in EAPOL frame.
17:11:37.922  inputEAPOLFrame: decrypting key data
17:11:37.922  inputEAPOLFrame: Received message 1 of 2
17:11:37.922  installGTK: setting cipher key (flags = 0x0)
17:11:37.922  GTK-RSC:
17:11:37.922 [00000000] 00 00 00 00 00 00
17:11:37.922  GTK:
17:11:37.922 [00000000] BE 20 03 56 DA EA A0 6F C2 FF 4B AB 9E 2F B9 D7
17:11:37.922  installGTK: GTK installed


17:11:56.027 Driver Event: pid]> _bsd_80211_event_callback: LINK_QUALITY (en0)
17:11:56.029 Info: pid]> _bsd_80211_event_callback: en0 link quality: RSSI=-71 dBm TxRate=176 Mbps

17:12:01.029 Driver Event: pid]> _bsd_80211_event_callback: LINK_QUALITY (en0)
17:12:01.030 Info: pid]> _bsd_80211_event_callback: en0 link quality: RSSI=-71 dBm TxRate=117 Mbps

17:15:44.611 Info: pid]> SCAN request received from pid 389 (locationd) with priority=2, qos=-1 (default),frontmost=no

17:15:44.812 Driver Event: pid]> _bsd_80211_event_callback: SCAN_CACHE_UPDATED (en0)

17:15:44.815      3cfc0> [ 1(2GHz),  20MHz, active],
17:15:44.815      0ef60> [ 2(2GHz),  20MHz, active],
17:15:44.815      1de20> [ 3(2GHz),  20MHz, active],
17:15:44.815      4bd10> [ 4(2GHz),  20MHz, active],
17:15:44.815      57ec0> [ 5(2GHz),  20MHz, active],
17:15:44.815      08b60> [ 6(2GHz),  20MHz, active]

17:15:44.816 Info: pid]> TRIMMED QUERY SCAN CACHE request received from pid 389 (locationd)
17:15:45.060 Driver Event: pid]> _bsd_80211_event_callback: SCAN_CACHE_UPDATED (en0)
17:15:45.062 AutoJoin: pid]> Successful cache-assisted scan request for locationd with channels {(
17:15:45.062      477c0> [ 7(2GHz),  20MHz, active],
17:15:45.062      14e00> [ 8(2GHz),  20MHz, active],
17:15:45.062      52620> [ 9(2GHz),  20MHz, active],
17:15:45.062      1f530> [10(2GHz),  20MHz, active],
17:15:45.062      4bf40> [11(2GHz),  20MHz, active],
17:15:45.062      79d10> [36(5GHz),  40MHz(+1), active]

17:15:45.063 Info: pid]> TRIMMED QUERY SCAN CACHE request received from pid 389 (locationd)
17:15:45.312 AutoJoin: pid]> Successful cache-assisted scan request for locationd with channels {(
17:15:45.312      53b70> [40(5GHz),  40MHz(-1), active],
17:15:45.312      67000> [44(5GHz),  40MHz(+1), active],
17:15:45.312      76650> [48(5GHz),  40MHz(-1), active],
17:15:45.312      60370> [149(5GHz), 80MHz,     active],
17:15:45.312      53950> [153(5GHz), 80MHz,     active],
17:15:45.312      765a0> [157(5GHz), 80MHz,     active]

17:15:46.097 AutoJoin: pid]> Successful cache-assisted scan request for locationd with channels {(
…
17:15:48.438      06900> [140(5GHz), 40MHz(+1), DFS],
17:15:48.438      5b9d0> [144(5GHz), 40MHz(-1), DFS]


17:15:52.249 Driver Event: pid]> _bsd_80211_event_callback: LINK_QUALITY (en0)
17:15:52.249 Info: pid]> _bsd_80211_event_callback: en0 link quality: RSSI=-71 dBm TxRate=176 Mbps

17:15:54.826 Info: pid]> TRIMMED QUERY SCAN CACHE request received from pid 501 (WiFiAgent)

17:15:54.834 Info: pid]> QUERY GAS CACHE request received from pid 501 (WiFiAgent)
17:15:54.834 Info: pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)

17:15:54.851 Info: pid]> GET CURRENT TETHER DEVICE request received from pid 501 (WiFiAgent)
17:15:54.852 Info: pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)
17:15:54.866 Info: pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)

17:16:04.260 Driver Event: pid]> _bsd_80211_event_callback: LINK_QUALITY (en0)
17:16:04.260 Info: pid]> _bsd_80211_event_callback: en0 link quality: RSSI=-71 dBm TxRate=156 Mbps

17:18:16.471 Info: pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)

17:18:16.536 Info: pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)

17:18:16.584 Info: pid]> __addDeviceUUID: Adding WiFi-specific device UUID
17:18:16.585 SC: pid]> airportdProcessSystemConfigurationEvent: airportdProcessSystemConfigurationEvent -       Autojoining on interface: en0

17:18:16.586 AutoJoin: pid]> AUTO-JOIN trigger requested (Preferred Networks List Changed)
17:18:16.586 Info: pid]> QUERY ALL WIFI NETWORKS request received from pid 501 (WiFiAgent)
17:18:16.588 AutoJoin: pid]> user: dgerman
17:18:16.588 Info: pid]> PRIORITY LOCK ADDED [client=airportd, type=4, interface=en0, priority=7]
17:18:16.588 Info: pid]> -[CWXPCSubsystem clearScanCacheWithInterfaceName:daemon:familyAndDriver:connection:error:]: 
                                             +Clearing family+driver scan cache for interface en0
17:18:16.588 Info: pid]> REQUEST DEFERRED minimum=7 [client=airportd, type=10, interface=en0, priority=2]
17:18:16.588 AutoJoin: pid]> AUTO-JOIN STARTED for interface en0 (Preferred Networks List Changed)
17:18:16.588 AutoJoin: pid]> NOT RECOVERY MODE => continuing
17:18:16.599 AutoJoin: pid]> Reviewing the preferred networks list

++++++++++=all networks ever seen!!!++++++++++++++++++++++++++ all are WPA2/WPA3 Personal unless noted. WF8300-0712 Open] blueStreak Open] 14Vermont Fios-Q8EDY-5G TP-LINK_A52016 disabled RuuviGateway D829 dlink-CA9E WPA/WPA2 Personal] Omega-CFDC gpy-wlan-7b7c Omega-D594 RuuviCollector 1.1 Fios-Q8EDY Fios-fN4Lr BarberShop WEP40 OpenSystem] bslguest Fios-IETFS disabled-plus ARRIS-8521 Meckanation 17:18:16.602 AutoJoin: pid]> Ignoring disabled network ['Dennis s iPhone' (wifi. Personal] 17:18:16.602 AutoJoin: pid]> Ignoring disabled network ['iPhone' (wifi.ssid /WPA3 Personal] RKH9S PA3 Personal] FiOS-E3V4C-5G FiOS-E3V4C Omega-98F5 Omega-9A55 Open] Omega-4581 Omega-DD81 17:18:16.602 AutoJoin: pid]> Ignoring disabled network ['TP-Link_Extender' (wifi.ssid 7874656e646572) - Open] AH_GUEST' (wifi.ssid Open] FiOS-PB4F9-5G NP5CD PA3 Personal] FiOS-PB4F9 Dennis's iPhone Cloverleaf Bar Meck4 PA3 Personal] Pomerantzhome Pomerantzhome_5GEXT WPA/WPA2 Personal] FiOS-IXU9D ToothFairy WPA/WPA2 Personal] FBI Surviellance Van #2_5G 17:18:16.608 AutoJoin: pid]> NOT FILE VAULT BOOT => continuing 17:18:16.608 AutoJoin: pid]> NOT LOGINWINDOW MODE 802.1X => continuing 17:18:16.608 AutoJoin: pid]> NOT LINK DOWN RECOVERY => continuing 17:18:16.608 AutoJoin: pid]> NOT MAINTENANCE WAKE => continuing 17:18:16.608 AutoJoin: pid]> NOT PERSONAL HOTSPOT TRANSITION => continuing 17:18:16.610 AutoJoin: pid]> Collocated network wifi.last 30 days, more recently than wifi.ssid.64697361626c6564, or within 30 days of wifi.ssid.64697361626c6564, skipping 17:18:16.610 AutoJoin: pid]> Collocated network wifi.st 30days, more recently than wifi.ssid.64697361626c6564, or within 30 days of wifi.ssid.64697361626c6564, skipping
while x=1; 
    do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 0.5; done

     agrCtlRSSI: -79
     agrCtlRSSI: -78
     agrCtlRSSI: -78
while x=1; 
do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI |\
 sed -e 's/^.*://g' | xargs -I SIGNAL printf "\rRSSI dBm: SIGNAL"; sleep 0.5; done
RSSI dBm: -77 changes, stays on same line due to  "\r"


Examples:

Sniffing on channel 1:

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport en1 sniff 1

Configuring preferences

 sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport  en0 \
         prefs JoinMode=Preferred RememberRecentNetworks=NO RequireAdmin=YES

Erros:

If nonexistant interface is specoified (example en1 NO error m,essage is displayed, help is displayed.

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport en1 --logger
airport: unrecognized option `--ooo'

Is Interface correct?

man airport Not available as of 12/18/22! this documentation based on help.