I have setup a sys-vpn Qubes using the community guide here. My sys-vpn template is Debian-12 with Wireguard installed and nothing else.
I use a Wireguard config from ProtonVPN, which has AllowedIPs = 0.0.0.0/0, ::/0 and some Endpoint = 1.2.3.4:51820 in the peer configuration. I added this Endpoint to the Qubes Firewall settings per the original guide and everything works flawlessly for WAN connections. By default, this prohibits direct access to LAN hosts.
I need to setup split tunneling (on sys-vpn, if I am not mistaken?), such that any AppVMs using sys-vpn as their NetVM can:
- Ping 1.1.1.1 through the Wireguard interface.
- Ping my local router gateway at 172.22.132.1 through eth0 interface, bypassing Wireguard.
I have tried to manually update some settings to be able to connect to 172.16.0.0/12 locally, and otherwise route through Wireguard.
What I have attempted:
- Using this IP calculator to disallow 172.16.0.0/12, calculate the
AllowedIPs = 0.0.0.0/1, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/6, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/2 - I manually updated the
AllowedIPs(per above) in mywg0.conffile - Run
nmcli connection delete wg0and thennmcli connection import type wireguard file wg0.confto re-import the updated Wireguard config - Add
172.16.0.0/12to the allowed connections in the Qubes Firewall Rules forsys-vpn - Restart
sys-vpn
My updated Wireguard config looks like this:
[Interface]
PrivateKey = [REDACTED]
Address = 10.2.0.2/32
DNS = 10.2.0.1
[Peer]
PublicKey = [REDACTED]
#AllowedIPs = 0.0.0.0/0, ::/0
AllowedIPs = 0.0.0.0/1, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/6, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/2
Endpoint = [REDACTED]:51820
After taking the above steps, I am then able to ping my local router gateway at 172.22.132.1. But I can no longer establish WAN connections (ping 1.1.1.1 does not work).
So I am only able to either reach local networks, or WAN networks, and not both simultaneously via split tunneling.
I have not setup any special nft rules. I have not done any additional hardening steps discussed in this guide. I have tried all the same steps again, rebuilding sys-vpn from scratch and have the same result.
Is there something else I need to do? Should I expect this to work under any circumstance? Finally, is there any reason I should not try to do this? Assuming either that I do or do not completely trust the hosts in 172.16.0.0/12.