Networking – How Does a VPN Manage Local IP Addresses

ipnetworkingvpn

When you have devices with the same static IP addresses on two networks how does a VPN keep them straight?

Example: I have a small network in my home office with 3 computers. I routinely connect to a remote office that has a Sonicwall router w/VPN using the Sinicwall VPN client on my main machine. Once connected, I am still able to access devices on both networks which use static IPs (they are servers.)

Both LANs use 192.168.0.x addressing. When I specify using a device like a server or printer at say 192.168.0.10 how does it determine whether to use the address on my physical local LAN or the one on the remote LAN?

Is it doing NAT translation similar to what the router does when it connects to the Internet?

Am I just "lucky" it's working?

Best Answer

To answer your question, Yes, you're "lucky" it's working.

When you connect to your VPN, your tunnel interface is assigned an IP by that remote DHCP server. So you're technically routing from the VPN server to your remote devices. You're probably connecting to your servers via their DNS names or something, which is resolved by your DNS servers locally. In which case if it couldn't find it, it'll search in your remote office.

So technically yes, this'll work. But it is not very efficient.

EDIT**

VPN diagram

So for eg. your VPN client is assigned an address by the SSL VPN. Which could be a different network address range. (eg. 172.16.32.0/16) While your remote network is working in the 192.168.1.0/24 range. The VPN server can be configured to bridge the two networks together.

The IP that your VPN client gets is not from the remote site's system/router's DHCP server, but rather the VPN server's DHCP server.

About the DNS, I don't really know how to explain properly. It uses a mix of DNS, ARP and RARP requests to determine the correct device. Hopefully this is enough to understand.

Related Question