On linux, this is trivial. I have my private subnet over Wireguard and hosts with static IPs all on the 10.79.x.y subnet. All other traffic goes through my commercial VPN provider.

Problem is, ya cain’t do that on Android, as it supports exactly one VPN connection at a time. The best you can do is white/blacklist traffic to either go through the VPN, or not.

Do how do I achieve this? My commercial VPN provider will not nest and route on their end; I could route all traffic through my VPS servers, but that’s a lot of traffic for my little VMs. It may, however, be my only option:

  1. Phone is connected to my VPS over WG VPN
  2. VPS is connected to internet via commercial WG VPN
  3. Routing tables on VPS send 10.79.x.y to destinations over the private VPS
  4. Public destinations get sent over commercial VPS

Am I missing an easier, more efficient work-around for Android’s utterly stupid networking limitations?

  • zer0@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    18 days ago

    You can use two separate VPNs if you use a work profile to run the second one. I’m not sure if this would work for your use case though. Check out Shelter if you want to give it a try.

    • BearOfaTime@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      18 days ago

      Aren’t those VPNs isolated to that profile then? So only apps within that profile use the VPN in the profile?

      Just trying to make sure I understand how Android does isolation. I guess if you run the apps that need each VPN in the appropriate profile and Island makes the isolation kind of transparent, it should work.

      I’ve used Island for the app isolation, and a shortcut to an app will simply log in to the associated profile to launch the app. Just never tried with dual VPN.