Hi,
First I should mention that the local and and remote LANs sit on 192.168.1.0. My local/client LAN router is sitting at 192.168.1.1. The remote LAN router is also sitting on 192.168.1.1. What I want is to type 192.168.1.1 in the browser and reach the remote LAN. I have been able to do this on my Android phone, but not on my Linux laptop. I use absolutely identical settings on both devices. The reason behind this effort is that I want to be able to access my remote/VPN LAN regardless of the network I am currently connected at the moment - I travel a lot. Here's the config files:
server.conf
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/crt-openvpn.crt
key /etc/openvpn/easy-rsa/keys/key-openvpn.key
dh /etc/openvpn/easy-rsa/keys/dh4096.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
cipher AES-256-CBC
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
auth SHA256
comp-lzo
user nobody
group nobody
persist-key
persist-tun
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.8.0.1"
status /var/log/openvpn-status.log
verb 3
log-append /var/log/openvpn
status /tmp/vpn.status 10
client.conf
client
remote 'name' 1194 - removed actual address since this is public
dev tun
proto udp
resolv-retry infinite
nobind
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/key.crt
key /etc/openvpn/keys/key.key
ns-cert-type server
keepalive 10 120
tls-auth /etc/openvpn/keys/ta.key 1
cipher AES-256-CBC
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256
auth SHA256
comp-lzo
user nobody
group nobody
persist-key
persist-tun
verb 3
I have also set up dnsmasq to make sure DNS queries are dealt with on the VPN server. This works fine. The only issue remaining as I said before is when I try to load 192.168.1.1 from the client. On my Android phone, this redirects to the remote router as I want it to. But on my Linux machine it goes to my local router, which I do not want. I fail to understand how and why the laptop sees the local LAN when I have instructed it to communicate everything through the remote LAN.
What I have discovered is that if I change my local LAN to 192.168.2.0, I am able to reach 192.168.1.1 on the remote LAN. But since I travel a lot and cannot always connect to a network I manage, I cannot ensure the local subnet will not match the remote one. Thus I wish to be able to reach the remote LAN regardless of the local setup. How is this achieved?
Thanks.