0

My VPN sets up my routing table with 0/1 & 128.0/1 to their gateway.

However they also set the range of their data center to my local gateway. Let's say 123.456.789.123/32 routes to 192.168.1.1

The default route is also left as 192.168.1.1

Why would they route their netblock to my gateway?

1

If this is a WireGuard VPN, what you're calling "their gateway" is probably a virtual IP address associated with the virtual WireGuard network interface running on your machine (with the interface probably named wg0 or similar, and the IP address probably belonging to one of the private-use blocks like 10.0.0.0/8).

Adding routes for 0/1 and 128/1 to this interface ensures that those routes have a lower priority than any other explicit routes you already have set up for your machine (like you probably have a 192.168.1.0/24 route for your LAN) -- but have a higher priority than your default route. So the 0/1 and 128/1 routes don't interfere with your custom routes, but they do override your default route.

So any traffic not matching any other routes you have set up will be routed through this virtual WireGuard network interface, where it will be encrypted and queued to be sent to your VPN provider. But in order to send this encrypted traffic from the virtual WireGuard interface to your VPN provider, your machine needs to know the real route to the VPN provider's real servers.

That's why your VPN provider has added an explicit route for their servers -- the encrypted WireGuard traffic needs to be routed through your local Internet gateway to their servers. Without an explicit route with a higher priority, the encrypted traffic bound for their servers would match either the 0/1 or the 128/1 route, and loop back into the virtual WireGuard interface again.

0

So your VPN software can reach the VPN servers. That traffic can't go over the VPN; it is rather the traffic that tunnels the VPN traffic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.