I successfully configured a VPN connection to my Home network over internet following this guide.
The current configurations is:
Home Network (Remote)
LAN:
192.168.1.1 => Router/Modem Gateway
192.168.1.20 => OpenVPN server (BananaPI device) on port 1194
192.168.1.40 => Other Device (with WebInterface)
Services:
The ISP has a Dynamic Public IP so in the Router a Dynamic DNS service is configured:
my.domain.com points to the public IP
Port Forwarding:
- External Port 1194 is forwarded to Local 1194 for 192.168.1.20
(I can access the VPN server from internet at the address my.domain.com:1194)
Client Network (Local)
192.168.1.1 => Router/Modem Gateway
192.168.1.2 => VPN Client (connects to my.domain.com:1194 and gets 10.8.0.6 Ip address)
With this configuration I can successfully connect to VPN, I have internet access and the IP reported from http://whatsmyip.com when I'm connected with the client to the VPN is the Home Newtork's as expected. I can also access 192.168.1.40
web interface from Client Network over internet when (obviously) connected to VPN.
The only issue is if I visit 192.168.1.1
when connected to VPN I get the configuration web interface of the Client Network's router and not the Home Network's.
How shoud I solve this IP collision?
route print
from (Windows) Client (192.168.1.2 on Client Network)
IPv4 route table
===========================================================================
Active Route:
Network Destination Mask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.3 20
0.0.0.0 128.0.0.0 10.8.0.5 10.8.0.6 20
10.8.0.1 255.255.255.255 10.8.0.5 10.8.0.6 20
10.8.0.4 255.255.255.252 On-link 10.8.0.6 276
10.8.0.6 255.255.255.255 On-link 10.8.0.6 276
10.8.0.7 255.255.255.255 On-link 10.8.0.6 276
82.104.210.184 255.255.255.255 192.168.1.1 192.168.1.3 20
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
128.0.0.0 128.0.0.0 10.8.0.5 10.8.0.6 20
192.168.1.0 255.255.255.0 On-link 192.168.1.3 276
192.168.1.1 255.255.255.255 192.168.1.1 192.168.1.3 20
192.168.1.3 255.255.255.255 On-link 192.168.1.3 276
192.168.1.255 255.255.255.255 On-link 192.168.1.3 276
192.168.56.0 255.255.255.0 On-link 192.168.56.1 276
192.168.56.1 255.255.255.255 On-link 192.168.56.1 276
192.168.56.255 255.255.255.255 On-link 192.168.56.1 276
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.56.1 276
224.0.0.0 240.0.0.0 On-link 192.168.1.3 276
224.0.0.0 240.0.0.0 On-link 10.8.0.6 276
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.56.1 276
255.255.255.255 255.255.255.255 On-link 192.168.1.3 276
255.255.255.255 255.255.255.255 On-link 10.8.0.6 276