macOS Wi-Fi: wdutil, networkQuality, system_profiler, systemsetup, security
Five built-in macOS command-line tools for Wi-Fi and network troubleshooting: wdutil for the Wi-Fi link, networkQuality for internet capacity and responsiveness, system_profiler for reports, systemsetup for time/NTP/SSH settings and security for saved Wi-Fi passwords. They are macOS-only, so the video shows syntax and Apple's documented output, plus a Linux iperf3 lab for the same idea.
182.1 Why is it used?
- wdutil: Wireless Diagnostics from the command line (RSSI, noise, channel, logs, diagnose bundle for support).
- networkQuality (macOS 12+): uplink/downlink capacity and Responsiveness (RPM), i.e. latency under load.
- system_profiler: hardware and network report (Wi-Fi card, current network) as text, XML or JSON.
- systemsetup: date, time zone, NTP, Wake on LAN, remote login (SSH), computer name.
- security find-generic-password: read a saved Wi-Fi password from the keychain (with permission).
- Many of these commands need sudo.
182.2 How it works: link vs whole path
- wdutil info only checks the Wi-Fi link between the Mac and the router: signal strength and noise.
- networkQuality loads the whole internet path: it uploads and downloads a lot of data to Apple's test servers (it consumes data).
- During that load it sends small requests and measures how quickly replies come back.
- Under upload the router buffer fills, small packets wait in the queue: this is bufferbloat, the lag you feel in a video call.
- Result is reported as RPM (round trips per minute): higher RPM = more responsive; Apple labels it Low, Medium or High.
- Step 1
1.MacBook (en0, Wi-Fi) -> Wi-Fi router (ch 149, 5 GHz) -> Apple test servers
- Step 2
2.networkQuality starts a bulk upload
- Step 3
3.Router buffer fills up: packets queue
- Step 4
4.A small request has to wait in that queue
- Step 5
5.Reply comes back late: latency under load goes up
- Step 6
6.networkQuality reports it as RPM (Low / Medium / High)
wdutil sees only the Wi-Fi hop; networkQuality sees the whole path under load
182.3 wdutil (Wireless Diagnostics)
| Command | What it does |
|---|---|
| sudo wdutil diagnose | Run all Wireless Diagnostics tests without the UI (report in /var/tmp) |
| diagnose -f <dir> | Save the report into your own folder |
| sudo wdutil info | Current Wi-Fi details |
| log +dhcp +od | DHCP and OpenDirectory logging on |
| log +dns / log +wifi | DNS / Wi-Fi logging on |
| log -eapol | EAPOL logging off |
| sudo wdutil dump | Write the log buffer to /tmp/wifi-*.log |
sudo wdutil info$ sudo wdutil infoSSID : HomeWiFiRSSI : -55 dBmNoise : -92 dBmChannel : 149 (5GHz, 80MHz)Tx Rate : 866.0 Mbps- Documented example from the course PDF (no Mac in the lab).
- SNR = signal - noise = -55 - (-92) = 37 dB.
- Good link: RSSI above -67 dBm and SNR above 25 dB.
- Newer macOS versions may show the SSID as redacted.
182.4 networkQuality
| Option | Meaning |
|---|---|
| (none) | Upload + download in parallel, plus RPM |
| -v | Verbose detail |
| -s | Upload and download separately (sequential) |
| -d / -u | Skip download / skip upload (with -s) |
| -I en0 | Test only on this interface |
| -M 20 | Max run time in seconds |
| -c / -c result.json | JSON to stdout / into a file |
| -p | Via iCloud Private Relay |
| -f h1|h2|h3, -f L4S, -f noL4S | Force HTTP version, L4S on/off (combine: -f h2,noL4S) |
| -r 17.253.0.1 | Skip DNS, connect to this IP |
| -C <url|file://> | Custom server config |
| -S 4433 / -k | Start a local test server (self-signed) / client skips TLS verify |
| -b / -B "Office NQ" | List Bonjour servers / test this Bonjour server |
networkQualitynetworkQuality -s -vnetworkQuality -I en0 -c \ | python3 -m json.tool$ networkQuality==== SUMMARY ====Uplink capacity: 38.512 MbpsDownlink capacity: 245.115 MbpsResponsiveness: High (1650 RPM)Idle Latency: 18.250 milliseconds182.5 Linux equivalent lab: capacity and latency under load
- Not networkQuality: the same idea on Linux with iperf3 in a Docker lab (client 192.168.202.20, server 192.168.202.10).
- -R reverses the direction (server sends), i.e. download.
iperf3 -c 192.168.202.10 -t 5 | tail -4iperf3 -c 192.168.202.10 -t 5 -R | tail -4$ iperf3 -c 192.168.202.10 -t 5 | tail -4[ 5] 0.00-5.00 sec 2.60 GBytes 4.47 Gbits/sec receiver$ iperf3 -c 192.168.202.10 -t 5 -R | tail -4[ 5] 0.00-5.01 sec 2.21 GBytes 3.79 Gbits/sec 2693 sender[ 5] 0.00-5.00 sec 2.20 GBytes 3.79 Gbits/sec receiverping -c 10 -i 0.2 192.168.202.10 | tail -2iperf3 -c 192.168.202.10 -t 8 -P 4 \ > /tmp/load.txt & sleep 1ping -c 20 -i 0.2 192.168.202.10 | tail -2ping -c 10 -i 0.2 192.168.202.10 \ | awk -F/ '/^rtt/ {print $5, 60000/$5}'$ ping -c 10 -i 0.2 192.168.202.10 | awk -F/ '/^rtt/ {print $5, 60000/$5}'0.113 530973- Idle ping average was about 0.15 ms.
- With 4 parallel iperf3 streams filling the link, the average rose to about 1.5 ms (max 24 ms): about 10x more delay under load.
- RPM = 60000 / average ms; on the idle link that is about 5 lakh round trips per minute.
182.6 system_profiler
system_profiler # full text reportsystem_profiler -listDataTypes # all data typessystem_profiler SPAirPortDataType # only the Wi-Fi reportsystem_profiler SPSoftwareDataType SPNetworkDataTypesystem_profiler -xml > network.spx # XML for System Informationsystem_profiler -json SPAirPortDataType # JSON for scriptssystem_profiler -detailLevel mini # no personal info (basic, full)system_profiler -timeout 30 2>/dev/null # max wait (default 180), hide progress182.7 systemsetup
| Area | Get | Set |
|---|---|---|
| Date / time | -getdate, -gettime | -setdate 04:15:26, -settime 16:20:00 |
| Time zone | -gettimezone, -listtimezones | -settimezone Asia/Kolkata |
| NTP | -getusingnetworktime, -getnetworktimeserver | -setusingnetworktime on, -setnetworktimeserver time.apple.com |
| Wake on LAN | -getwakeonnetworkaccess | -setwakeonnetworkaccess on |
| Modem wake | -getwakeonmodem | -setwakeonmodem off |
| SSH | -getremotelogin | -setremotelogin on, -setremotelogin -f off |
| Apple events | -getremoteappleevents | -setremoteappleevents on |
| Names | -getcomputername, -getlocalsubnetname | -setcomputername "Office-Mac", -setlocalsubnetname office-mac |
| Help | -version | -help, -printCommands |
- Most systemsetup commands need sudo; remote login also needs Full Disk Access.
- -setremotelogin -f off turns SSH off without confirmation: it can cut your own remote session.
182.8 security find-generic-password
- macOS saves a Wi-Fi password as a generic password: service AirPort, account = your SSID.
- -w prints only the password; -g also shows the attributes.
- -a (account), -s (service), -D (kind), -l (label), -j (comment), -c/-C (creator/type codes), -G (generic attribute) narrow the search.
- A keychain path at the end (e.g. /Library/Keychains/System.keychain) limits the search to that keychain.
security find-generic-password \ -D "AirPort network password" \ -a "MyWiFi" -w # Keychain dialog (Apple Support):# Deny no password given# Allow Once this time only# Always Allow always, no asking# Keychain Access: "Show password"# asks for keychain password182.9 Common mistakes
- Treating networkQuality as just a speed test: the key number is Responsiveness; two links with the same Mbps can give very different call quality.
- Blaming Wi-Fi signal for a freezing call when capacity is high and responsiveness is Low: that is bufferbloat.
- Running systemsetup -setremotelogin -f off over SSH and locking yourself out.
- Reading passwords on a Mac or network that is not yours.
182.10 Interview tips
- Mac Wi-Fi diagnosis: sudo wdutil info (RSSI, noise, channel) -> networkQuality (capacity + RPM) -> system_profiler report -> share the wdutil diagnose bundle.
- SNR = RSSI - noise; good link is RSSI > -67 dBm and SNR > 25 dB.
- RPM = round trips per minute under load; low RPM with high Mbps = bufferbloat.
- Wi-Fi passwords live in the keychain as generic passwords (service AirPort, account SSID).