I am new to networking and have an OpenVPN server running with tun interface on a headless Ubuntu Server 16.04 . I am trying to access my resources in my LAN remotely using the, openVPN service I have setup, in an office that is set behind another LAN which is the gateway to the WAN. So Router 1/Gateway has an address of 192.168.x.0

Router 2 which is the lead way to my private subnet is 192.168.x.1(All devices in this network have static IP's)

How do I configure my OpenVPN server to allow me to access my resources in the second LAN. I amnew to networking and have done alot of research, but feel like I'm missing some concepts that are disabling me from moving forward. I want to route instead of bridge like the OpenVPN website suggests for now. Do I configure the server.conf file on the server and if so how do route to the address specified above? Also do I do some port forwarding from router 1 to router 2 get the traffic over the VPN once enabled to route to my network. Right now my virtual machine network setting is on NAT and I would also like to know what is the best setting to accomplish my task. I have researched for about a week now and can't find anything clear enough to explain these concepts if someone could help please!


To access my LAN from my VPN server I added this line to server.conf

route add mask gw is my server's static IP address from my router. You may have to modify the addresses based on your setup.

  • How do I direct traffic to my LAN with the private subnet though do I do port forwarding from the router the is the gateway to the WAN? – Jstack May 25 '17 at 4:04
  • how did you add this? it complains about the syntax – Mohammed Noureldin Jan 12 '18 at 17:58
  • That's a direct, correct copy of the line out of my server.conf . apt-cache policy openvpn gives me 2.3.10-1ubuntu2.1, perhaps you are running a different version. – Organic Marble Jan 12 '18 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.