SCENARIO
I have my headless RPi 4 running Raspbian Buster Lite setup as a NAT router, using the internal antenna wlan0 to connect to the WAN, and an external USB antenna wlan1 with its own SSID.
I am achieving this using dnsmasq and hostapd.
IPTABLES is setup to allow ipv4 traffic to flow between wlan0 and wlan1, thus sharing WAN traffic on wlan0 with the LAN traffic on wlan1.
Connecting wlan0 to networks which only require the SSID and PSK is easy enough using wpa_cli or wpa_supplicant works fine.
THE ISSUE
Certain public WiFi APs require a web login before allowing traffic on their network. On a headless RPi, this doesn’t work so well.
BEHAVIOUR
Currently, when connecting to such a public AP, I am able to connect to their network, as when I run
ifconfig wlan0
I can see that I have been assigned an IP by the host router, but I have no internet.
If I try using w3m to try to force a load of their logon page, w3m is not able to display the page.
WHAT NEXT?
Is there a way to acknowledge the logon page with w3m or some other CLI browser?
Or, is there another way to connect to such networks using the CLI? Perhaps by assigning my mobile’s MAC address to wlan0, so that I can acknowledge the logon page on my mobile? Is that possible, and would it work? How would I do that?
UPDATE
Using lynx produced the same result.
$ lynx mcd-en.datavalet.io
Welcome to datavalet!
ACKNOWLEDGMENTS
A big THANK YOU to the community for being a great sounding board for projects like this one.