Skip to content

Instantly share code, notes, and snippets.

@0bmxa
Last active March 14, 2024 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0bmxa/2dc489e29a2ba6f940f069039d2896d2 to your computer and use it in GitHub Desktop.
Save 0bmxa/2dc489e29a2ba6f940f069039d2896d2 to your computer and use it in GitHub Desktop.
Enable/fix macOS WiFi roaming (802.11k, 802.11r, 802.11v)
# 1. Enable roaming
sudo defaults write /Library/Preferences/com.apple.airport.opproam enabled -bool true
# (Optional) Un-disable roaming
#sudo defaults write /Library/Preferences/com.apple.airport.opproam disabled -bool false
# 2. Prefer networks with stronger signals
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport en0 prefs JoinMode=Strongest
# (Optional) Set a fallback mode (Prompt, JoinOpen, KeepLooking, DoNothing)
#sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport en0 prefs JoinModeFallback=Prompt
# 3. Power cycle WiFi interface
networksetup -setnetworkserviceenabled 'Wi-Fi' off
networksetup -setnetworkserviceenabled 'Wi-Fi' on
# Check current settings
# Roaming settings
defaults read /Library/Preferences/com.apple.airport.opproam
# AirPort preferences
/usr/libexec/PlistBuddy -c 'Print :Sets:<ID>:Network:Interface:en0:AirPort' \
/Library/Preferences/SystemConfiguration/preferences.plist
# Or manually check <ID> → Network → Interface → en0 → AirPort → <JoinMode, etc.> with:
#defaults read /Library/Preferences/SystemConfiguration/preferences Sets
# To undo above changes
# (Careful with this!)
#sudo defaults delete /Library/Preferences/com.apple.airport.opproam enabled
#/usr/libexec/PlistBuddy -c 'Delete :Sets:<ID>:Network:Interface:en0:AirPort:JoinMode' \
# /Library/Preferences/SystemConfiguration/preferences.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment