I have managed to setup an OpenVPN server on my NAS at home, and I can connect with remote clients as expected.
My simplified network setup looks like this:
http://gofile.me/2o5tV/CeonlTvcb
On the LAN side, for this topic, the only relevant devices are the router/gateway on 192.168.1.1 and the NAS on 192.168.1.2. The NAS is running OpenVPN server and also has some shared folders that clients shall be able to map as \\NAS\$sharefolder
In order to access the 192.168.1.0/24 network, I seem to need an explicit route statement in the client config. I want my client configurations to be agnostic about the home LAN configuration. The reason is that I may change the LAN setup and I want to be able to do that without changing any client config.
The network configuration parts of the configs are (right now):
push "route 10.8.0.0 255.255.255.0"
#push "route 192.168.1.0 255.255.255.0"
server 10.8.0.0 255.255.255.0
management 127.0.0.1 1195
topology subnet
dev tun
proto udp
port 1194
max-clients 5
persist-tun
In the server config, I have commented out the try to push the LAN network to the client as I can't seem to get it to be pushed to the clients (seen if "View Original" is selected above). Therefore, I added a route option in the client config as below.
client
dev tun
proto udp
remote <my-host-ip> 1194
nobind
persist-tun
# Don't know why this route is not pushed by server... - Added to get access to local LAN
route 192.168.1.0 255.255.255.0
Should I do this in another way to get access to remote LAN from the client?
I read the guide
here but wonder how to do this part: "Make sure that you've enabled IP and TUN/TAP forwarding on the OpenVPN server machine." (
Edit: found an explanation here in an old thread)
Another thing I would like to solve as well is to be able to use the host "NAS" when connecting to a file share as mentioned above. Right now I have added an entry in the hosts file on the client to get this ability.