I would like to setup a small vpn server for a remote office of my company. The goal is to be able to access its network either from the corp network or from home.

Most of (if not all) clients will be running Windows (>=7).

To reduce costs, I want to reuse an old computer, where I setup ubuntu server 13.04. I've followed openvpn documention on ubuntu web site.

I've been able to deploy the packages. However, my general linux knowledge is limited, and I'm stuck at setting up the different configuration file.

Basically I have:

  • an internet connection, with a modem that have basic router features: dhcp server, nat translation, and port forwarding.
  • a single network where all computers are connected, including the internet modem and the vpn server (this server has only one network card).

My questions are:

  • the openvpn tutorials and sample config file I found are mentioning route configuration, ethernet bridging, etc. I admit I don't understand what I'm suppose to do. I simply want to grant access to the whole local network when a client connects?
  • as my clients will be mostly windows client, what specific configuration I'm supposed to apply in the server.conf file?
  • is there any sample configuration file specific to my scenario?
  • Am I stuck to openvpn client? Is there any chance to be able to use the native vpn client features of Windows (if this imply using another vpn server, I can evaluate it).

Ubuntu Server 14.04.1 How To setup OpenVPN server on a seperate machine than the LAN gateway (with access to other machines on server LAN)

Make sure your openvpn LAN is not the usual or If it is, log in to your router and change the third number ie. 192.168.(this number).1

Make sure to forward port 1194 on your router to the OpenVPN server IP

Example Network:

Gateway IP:  
OpenVPN Server IP:

OpenVPN Config:

 port 1194
 proto udp
 dev tun0
 ca ca.crt
 cert server.crt
 key server.key
 dh dh2048.pem
 ifconfig-pool-persist ipp.txt
 push "route"
 push "route"
 push "redirect-gateway def1 bypass-dhcp"
 push "dhcp-option DNS"
 push "dhcp-option DNS"
 keepalive 10 120
 tls-auth ta.key 0
 user nobody
 group nogroup
 status openvpn-status.log
 verb 3

Edit /etc/network/interfaces:

 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet static

 post-up iptables -t nat -A POSTROUTING -s -j SNAT --to

Make sure to comment out ipv6 setting

Edit /etc/sysctl.conf:





Assuming your keys and client configs are all squared away; Reboot your server and you should be good to go!

Once connected, ping from client:

  • I was fighting with this for about a month before i finally figured it out. Its ALL about that iptables rule! – Kallet Oct 20 '14 at 6:35

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.