So I have the following setup:
Now from home I like to make a connection through OpenVPN to access my LAN from work. So I edit the config of the OpenVPN client on my home computer to:
remote 180.135.0.10 1194
Now I can connect to it but it won't allow me to access the LAN just out of the box. So I add a new line to the clients config:
redirect-gateway def1
This will make sure all traffic will go through the VPN. This works. However now I don't have internet. So I add the following lines:
dhcp-option DNS 8.8.8.8
dhcp-option DNS 8.8.4.4
Now I can access the LAN through my VPN and when I check WhatIsMyIp it is clear that the internet traffic is going through the VPN also as I now have the work WAN IP. This is not preferred. In my ideal situation the only traffic that should go through the VPN is the LAN of work all other traffic such as internet and my home LAN should just route normal.
Does anyone have an answer how to accomplish such a thing?
Best Answer
If I understand your configuration and network topology, then you should delete the
redirect-gateway
directive and instead add:If you want reach work machines by name you should configure your work dns server (if any):
Delete the two Google DNS entries.
Regards
Paolo Basenghi