Configuration of OpenVPN For Debian

by michael on September 7, 2011

in VPN By Protocols

Here we will tell you how you can setup OpenVPN in Debian environment on both, server and client systems.

Server’s Configuration of OpenVPN For Debian

  1. First of all install the openvpn software on both, server and client .
  2. Go to ‘OpenVPN’ in server’s ‘etc’ directory by using the path ‘/etc/openvpn’.
  3.  Use the command given below to get a static key:
    • openvpn –genkey –secret static.key
  4. Now copy this key to the client side directory on the path ‘/etc/openvpn’. Be sure to use a secured connection like scp or sftp.
  5. Now on the server side, create a config path on the path ‘/etc/openvpn/tun0.conf’
  6. Add the following lines of code to it;
    • dev tun0
    • ifconfig
    • secret /etc/openvpn/static.key

In this code;

Subnetwork = 10.9.8.x

Server IP =

client’s IP =

Client’s Configuration of OpenVPN For Debian

  1. Create a similar configuration file as on server using the path ‘/etc/openvpn/tun0.conf’.
  2. Add the code given as follows;
    • remote
    • dev tun0
    • ifconfig
    • secret /etc/openvpn/static.key
  3. Access server’s firewall and allow UDP 1194 through it.
  4. Now add a new VPN zone for tun0 and create a default policy for it on both sides i.e client as well as server. You can do this by add the files given below to the path ‘/etc/shorewall’;
    • zone
    • interfaces
    • policy
  5. Now Run OpenVPN on client and server using the command as follows:
    • openvpn –config /etc/openvpn/tun0.conf –verb 6

Final Steps:

  1. Start the OpenVPN on the server and the client.
  2. Now will be the right time to configure routes to use the VPN tunnel:
    • Remove the default route through the proxy: route del default eth0
    • Add default route through your VPN: route add default gw dev tun0
    • You should keep the route to the proxy with: route add eth0

Update your configuration file in ‘/etc/resolv.conf’ as per requirement.

Best  OpenVPN Providers For Debian

There are a number of VPN service providers that you can contact to get an OpenVPN connection on Debian, however, not an easy task to determine which one is really the best. So we have made the list of following top providers to assist you;

Rank Provider Starting Price Visit Provider Site
1 ExpressVPN $6.67 /Month Visit Provider Site
2 Hidemyass $11.52 /Month Visit Provider Site
3 IPvanish $10.00/Month Visit Provider Site
4 StrongVPN $21/ 3 Months Visit Provider Site
5 VyprVPN $14.95/Month Visit Provider Site
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Leave a Comment

Previous post:

Next post: