In-flight and hotel WiFi can be quite expensive and often insist on charging users extra to connect multiple devices. In order to avoid that, it's possible to easily create a WiFi hotspot using NetworkManager and a external USB WiFi adapter .
The main trick is to right-click on the NetworkManager icon in the status bar and select "Edit Connections..." ( not "Create New WiFi Network..." despite the promising name).
From there click the "+" button in the lower right then "WiFi" as the Connection Type. I like to use the computer name as the "Connection name".
In the WiFi tab, set the following:
In the WiFi Security tab:
pwgen -s 63
While you may think that such a long password is inconvenient, it's now possible to add the network automatically by simplyscanning a QR code on your phone.
In the IPv4 Settings tab:
Finally, in the IPv6 Settings tab:
I ended up with the following config in
[connection] id=machinename uuid=<long UUID string> type=wifi interface-name=wl... permissions= timestamp=1578533792 [wifi] mac-address=<MAC> mac-address-blacklist= mode=ap seen-bssids=<BSSID> ssid=machinename_nomap [wifi-security] key-mgmt=wpa-psk psk=<63-character password> [ipv4] dns-search= method=shared [ipv6] addr-gen-mode=stable-privacy dns-search= ip6-privacy=0 method=ignore
In order for the packets to flow correctly, I opened up the following ports on my machine's local firewall:
-A INPUT -s 10.42.0.0/24 -j ACCEPT -A FORWARD -d 10.42.0.0/24 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A FORWARD -s 10.42.0.0/24 -j ACCEPT -A INPUT -d 188.8.131.52 -s 10.42.0.1 -j ACCEPT -A INPUT -d 184.108.40.206 -s 10.42.0.1 -j ACCEPT -A INPUT -d 10.42.0.255 -s 10.42.0.1 -j ACCEPT -A INPUT -d 10.42.0.1 -s 10.42.0.0/24 -j ACCEPT