Sometimes you need to connect a device (Nintendo Switch, Kindle) to public wifi with a login page that your device has no way to accept the terms and conditions. With this method you can spoof your MacBook with your device's MAC address to accept the T&C.
A MAC address is a series of letters and numbers in this format xx:xx:xx:xx:xx:xx
, and is usually used to identify device's on a wifi network that have accepted the terms and conditions.
Find the MAC address of your target device. e.g. xx:xx:xx:xx:xx:xx
On your MacBook, assuming your wifi device is en0
, you can get your current MAC address with:
ifconfig en0 | grep ether
Disconnect your MacBook from Wifi, but don't turn if off.
Then run the this command:
networksetup -setairportpower en0 on
Change the MAC address of your MacBook to your target MAC address:
ifconfig en0 ether xx:xx:xx:xx:xx:xx
Run
networksetup -detectnewhardware
Connect to the public wifi, and in a web browser, navigate to captive.apple.com
, and accept the Wifi's terms and conditions.
Disconnect your MacBook from the wifi and connect your target device to the wifi, and you should be good to go.
You can repeat the steps to restore your MacBook to it's original MAC address, or you can simply restart it. Either way, spoofing the MAC address isn't permanent.
captive.apple.com
in a web browser is nice way to force it to open up.sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 -z