For some unknown reason, IPv4 routing doesn’t work when using my iPhone as a personal Wi-Fi hotspot. I thought I’d try using it as a Bluetooth hotspot instead. Spoiler: Internet works flawlessly over Bluetooth!
Here’s a summary of the steps.
Connecting to the device
First, on the iOS device, open the Bluetooth settings. The device is
discoverable only while this screen is visible. Then, on the Alpine Linux host,
open bluetuith
(or any other program used to connect to Bluetooth devices),
scan for devices, and connect to the iPhone. A PIN will be shown on both
devices. Ensure that it matches, and press OK.
Enable the hotspot
On the iOS device, go to Settings > Personal Hotspot
, and enable the toggle.
Something equivalent is likely possible on devices with other operating systems.
Connecting to the Bluetooth PAN
Install bluez-tools
(I submitted a package recipe to the aports repo
as part of this work).
Use bt-device -l
to list all devices. Find the MAC address of the iOS device,
and then run bt-device -i XX:XX:XX:XX:XX:XX
to ensure that the iOS device
shows NAP
. If it doesn’t, then the personal hotspot is off.
Finally, run doas bt-network -c XX:XX:XX:XX:XX:XX nap
, using the MAC address
of the device found above.
The first time both devices reported that the connection was established, but no traffic flowed. After disconnecting and reconnecting twice, everything worked.
Not only was the IPv4 issue resolved, but the hotspot works perfectly, better than the Wi-Fi hotspot has ever worked on an iOS device.
Usability
When using the Wi-Fi hotspot, after the last device disconnects, the iOS device stops broadcasting the access point. Reconnecting to it requires unlocking the device and opening the Personal Hotspot screen again. It’s often necessary to toggle it off and on again.
When using the Bluetooth hotspot, my laptop can connect to the iOS device via
Bluetooth at any time, and the bt-network…
command requests access to the
network. I don’t need to reach for the iPhone every time.
Bluetooth is likely less power-hungry than Wi-Fi (at least for my typical use case). I admit I haven’t actually measured this. If you do measure this, please send me your data.