Networking Basics: How Do VPNs Route Traffic Without A Default Gateway

networkingvpn

I'm trying to better undstand how traffic is routed through a VPN on a windows machine.

I have a working vpn server at work that I am connected to from home. My networks subnet is 192.168.8.x

The vpn server's subnet is 192.168.1.x

If I right click on the established vpn connection and look at the connection details there is no default gateway listed for the network interface. Just an ip address, subnet mask, and DNS.

My understanding is that if you try to access any IP address that is outside your own subnet it then tries to get routed through a default gateway.

I figured with a VPN you simply would have two defaults gateways and your computer would just try both.

I'm obviosly very confused as to how this all works and would like to know how it is that if I type in 192.168.1.1 I get the router on the remoute network (VPN side) while i'm on a 192.168.8.x subnet…

Best Answer

My understanding is that if you try to access any IP address that is outside your own subnet it then tries to get routed through a default gateway.

Essentially correct. You use the default gateway if you don't have a more specific route to the destination. The default gateway is the "catch all" and should point to the router that provides you with Internet access.

I figured with a VPN you simply would have two defaults gateways and your computer would just try both.

That would work very, very poorly.

A VPN will only be your default route if it's intended to provide your Internet access. If it's just intended to provide you access to specific subnets on the other side of the VPN, then specific routes will be used to just those subnets, over the VPN.

Related Question