Two VPNs, One Laptop and a GPU Cluster: Debugging Routing Conflicts
Living in Russia and working with AI tools means I run a personal VPN most of the day. My AI editor and several model APIs simply do not work without it. Meanwhile, the remote GPU machines I use sit behind a corporate OpenVPN, and they are only reachable through it. Turn on both and something breaks: the editor stops answering, SSH hangs halfway through login, or the cluster's hostnames stop resolving.
None of this is magic. Two VPN clients are fighting over three things on one machine: routes, DNS and packet size. Once you can see those three, the fixes are boring.
Why two VPNs collide
Most VPN clients, when they connect, try to become your default route. To win against the existing default route without deleting it, they push two half-routes, 0.0.0.0/1 and 128.0.0.0/1. Together they cover the whole internet and beat 0.0.0.0/0 on specificity. When a second VPN connects and does the same thing, the most recently added routes (or the lower metric) win, and the first tunnel silently stops carrying traffic.
DNS goes the same way. Each client sets its own DNS servers. Your corporate hostnames (gpu-07.cluster.internal) only resolve through the corporate resolver, while the personal VPN wants all DNS to go through its own resolver to avoid leaks. Only one of them can be first.
Step 1: ask the OS which way a packet goes
Never guess. Ask the routing table about a specific destination.
# Linux
ip route get 10.20.4.17 # a GPU node
ip route get 104.18.32.47 # the AI editor's API
resolvectl status # which DNS server serves which interface
# Windows
Find-NetRoute -RemoteIPAddress 10.20.4.17 | Select-Object InterfaceAlias, NextHop
Get-NetRoute -AddressFamily IPv4 | Sort-Object RouteMetric | Select-Object -First 15
Get-DnsClientServerAddress
If the GPU node's address goes out through the personal VPN's interface, you have found the bug. That traffic is now being sent to a server in another country that has never heard of your private network.
Step 2: split the traffic on purpose
The goal is simple: the corporate tunnel carries only the cluster's networks, and everything else uses the personal VPN.
Corporate OpenVPN: stop it taking over. In the client config, refuse the pushed default route and add only the subnets you need:
route-nopull
route 10.20.0.0 255.255.0.0
route 10.21.0.0 255.255.0.0
(If your company forbids route-nopull, pull-filter ignore "redirect-gateway" keeps the server's other settings and drops only the default route.)
Personal WireGuard or AmneziaWG: exclude the private ranges. In a WireGuard-style config, AllowedIPs decides what goes into the tunnel. 0.0.0.0/0 means everything; replace it with the internet minus your corporate ranges. Most clients, including Amnezia, also have a split-tunnelling screen that does this per site or per app. AmneziaWG is a WireGuard fork that adds obfuscation parameters (junk packets and modified headers) so the traffic is harder to fingerprint. The routing rules are the same as in WireGuard.
DNS: route by domain. On Linux with systemd-resolved, send only the corporate domain to the corporate resolver:
resolvectl dns tun0 10.20.0.2
resolvectl domain tun0 '~cluster.internal'
The ~ makes it a routing-only domain: queries for *.cluster.internal go to that server, and everything else uses the default resolver. On Windows, the Name Resolution Policy Table (Add-DnsClientNrptRule -Namespace ".cluster.internal" -NameServers 10.20.0.2) does the same thing.
Step 3: the SSH hang is usually MTU
The strangest symptom: SSH connects, the password prompt or key exchange starts, and then everything freezes. Small packets get through; large ones do not.
Every tunnel adds headers. A 1,500-byte packet inside WireGuard inside another tunnel no longer fits in 1,500 bytes, and if ICMP "fragmentation needed" messages are blocked anywhere on the path, big packets just disappear. The SSH key exchange is one of the first big packets.
Test it, then lower the MTU:
ping -M do -s 1372 10.20.4.17 # Linux: increase or decrease the size until it fails
ping -f -l 1372 10.20.4.17 # Windows
Set the tunnel MTU a little below the largest size that worked (MTU = 1280 in a WireGuard config is a safe start, or tun-mtu 1400 plus mssfix 1360 in OpenVPN). The hang disappears.
Step 4: SSH to the GPU node, properly
With routing fixed, make the SSH side robust. My ~/.ssh/config:
Host bastion
HostName bastion.example.com
User viraj
ServerAliveInterval 30
ServerAliveCountMax 4
Host gpu-07
HostName 10.20.4.17
User viraj
ProxyJump bastion
LocalForward 8000 localhost:8000 # vLLM API on the node
LocalForward 8888 localhost:8888 # Jupyter
ServerAliveInterval 30
ssh gpu-07 now jumps through the bastion and forwards the model server to localhost:8000 on my laptop, so the editor can talk to it as a local endpoint. ServerAliveInterval stops idle tunnels being dropped by NAT along the way. For tunnels that must survive sleep and network changes, autossh restarts them automatically.
Bonus: the port 443 fight on a server
The same kind of conflict shows up on servers. When I put a website on one of my VPS machines, it was already running an Amnezia VPN container bound to port 443, which is the port the web server needs for HTTPS. Two services cannot listen on the same port. I moved the VPN to 8443, opened that port in the firewall and updated the clients. It took a few minutes and needed nothing more than knowing which process owned the port (ss -tlnp | grep :443).
The checklist
When two VPNs fight, check in this order:
- Routes:
ip route getorFind-NetRoutefor one address on each side. - DNS: which resolver answers for the corporate domain.
- MTU: a ping with "do not fragment" at increasing sizes.
- Ports: on servers, what is already listening.
Each VPN works fine on its own. The bugs live at the boundaries between them, and the fix is to draw those boundaries explicitly instead of letting the last client to connect decide.