VPN
A virtual private network (VPN) connects devices or whole networks over an existing network such as the internet. A secure VPN encrypts the traffic it carries between the two ends of the tunnel.
What a VPN does
A VPN gives devices a network path they would not otherwise have. For example, an engineer working from home can reach an internal dashboard without the company making that dashboard publicly accessible. The engineer's laptop connects to a VPN gateway, and the gateway forwards traffic into the company network. This is a remote-access VPN. A site-to-site VPN connects two networks instead, such as an office network and a private cloud network, with a gateway at each end.
How traffic gets through
In a typical secure VPN, the endpoints authenticate each other using credentials such as keys or certificates. When the operating system routes an IP packet into the VPN, the VPN wraps it in another packet for transport. This is called encapsulation. The outer packet has the addressing needed to cross the internet; the original packet is encrypted and protected against tampering. At the other end, the gateway verifies and decrypts the packet, then forwards it toward its original destination. WireGuard and IPsec are examples of technologies used to build secure tunnels.
Example: which traffic uses the tunnel?
Suppose an internal dashboard has the address 10.40.2.15. With split tunneling, the laptop might send traffic for 10.40.0.0/16 through the VPN while sending public web traffic directly through its usual internet connection. With full tunneling, the default route points into the VPN, so traffic to public sites normally goes through the gateway as well. Full tunneling gives the organization a common place to apply network policy, but it also increases the traffic the gateway must handle. IPv4, IPv6, and DNS need to be checked separately rather than assumed to follow the same path.
What a VPN does not do
Tunnel encryption ends at the tunnel endpoint. If the gateway forwards a request over another network, the VPN does not protect that next leg. HTTPS serves a different purpose: it protects the web connection up to the point where TLS terminates, which might be the service itself or a reverse proxy in front of it. A VPN also does not replace application authorization. Being able to reach a dashboard does not mean you have permission to view it, and routing web traffic through a VPN does not make you anonymous to a site you sign in to.
What comes up in interviews
A common troubleshooting prompt is: “The VPN says it's connected, but the internal service doesn't load. What would you check?” Separate name resolution from network reachability. Check whether the hostname resolves to the expected private address and whether the client has a route to that address through the tunnel. Then consider overlapping home and corporate address ranges, firewall rules, and the return path. A working tunnel is only one part of a working connection.