Hey everyone, I figured since many of you use wireguard and have deep knowledge on Android, you may be able to help me out. I haven't been able to find something that helps me anywhere else.
Basically, my goal is to have a wireguard interface on my phone which connects to two peers. One peer is an upstream VPN provider, and the other peer is my home network so I can access it on the go. I have the upstream peer set to allow all IPs (0.0.0.0/0
) and route them through there. On my home peer, the allowed IPs is (something like) 10.8.6.128/28
.
A handshake is successful on both peers, however, I can only actually connect through the upstream peer, and reach the internet. Attempts to connect to 10.8.6.128/28
fail, even to the home peer endpoint and home peer wireguard address 10.8.6.129
. If I separate the peers and only try connecting to one at a time, they both work completely, but combining them causes traffic to not be routed to the home peer.
I have an identical setup on my laptop (macos), which works flawlessly, connecting to both the home peer and upstream peer with no issues routing my desired IPs to home. This leads me to believe there is some quirk with android or wireguard on android that causes this sort of split tunneling to fail.
Here is an example of the config on my phone. Again, the config on my laptop is identical and it does work.
[Interface]
Address = 10.8.6.131/32
DNS = <upstream dns>, 10.8.6.129
PrivateKey = <phone private key>
[Peer]
AllowedIPs = 0.0.0.0/0
Endpoint = <upstream endpoint>:51820
PublicKey = <upstream public key>
[Peer]
AllowedIPs = 10.8.6.128/28, <home endpoint>/32
Endpoint = <home endpoint>:51820
PublicKey = <home public key>