How to use your lineage phone as a true VPN hotspot

Prerequisites:
1) A vpn

2 ) A phone running LineageOS

3) A mobile data plan with a large allowance

4) enough common sense to not piss off your cell carrier

Step one: read the prerequisites again. I am not responsible if you violate your mobile carriers TOS and get your contract terminated. 

Step two: pick your VPN provider of choice. I have not had good luck with openVPN in transit, as it does not keep the routing table during disonnects. If you are staying in a static location, this may be a non issue. I was using this to drive a dedicated GPS and music player in motion, and as such i was susceptable to this, and it became a great annoyance. You will hpwever, need a VPN that offers a true gateway functionality. I ended up using tailscale and a self-hosted exit node on one of my cloud tenants. This is faily easy and cheap to setup, though it comes with drawbacks in the form of reddit banning all cloud based ASN's. Your mileage may vary. 

Step three: in the LineageOS system settings, navigate to network -> hotspot. Toggle enable clients to use VPNs. This will force traffic out the system default gateway, instead of your ISP's gateway. If there is a VPN active on the system, it will recieve the traffic coming over hotspot. 


Notes: 
If android work profiles are enabled, there is some erratic behavior, especially if both work profiles have VPN active, but only one is a full tunnel. Also, it seems that which VPN is used in this situation is almost random. 

Sometimes with cell network roaming, VPN and hotspot will need to be toggled to regain connectivity. This has become more frequent on android 13 and later in more rural areas. 

Android 14's multi-sim failover feature does work with this, though there may be a minute or so as the VPN times out and reconnects. This is occasionally accompanied by the same symptoms of tower and network roaming, where reconnect does not completely work and refresh the routing table. 

 

This article was updated on April 18, 2024