Ubuntu : Setting OpenVPN Pre-Shared Static Key

38 sec read

:: What is
Setting OpenVPN with static key are ideal for point-to-point VPNs or proof-of-concept testing.

:: Installing OpenVPN Server in Ubuntu

aptitude install openvpn

:: Create Pre-Shared Static Key for OpenVPN

openvpn --genkey --secret /etc/openvpn/shared.key

:: Setup OpenVPN to use Pre-Shared Static Key

vi /etc/openvpn/server.conf

Add configuration like these:

dev tun
secret /etc/openvpn/shared.key
verb 3
mute 10

:: Starting OpenVPN Server in Ubuntu

/etc/init.d/openvpn start

:: Enable ip forwarding

vi /etc/sysctl.conf

Enable this line:


and apply sysctl for saved permanent

sysctl -p

:: Connection to OpenVPN Server from Ubuntu client
+ Installing OpenVPN Client

sudo aptitude install network-manager-openvpn-gnome

Add new OpenVPN connection using network-manager and add some like these:

  • VPN tab
  • Gateway: your-openvpn-server-ip
  • Static key: shared.key # static key file from server
  • Remote ip:
  • Local ip:
  • IPv4 Settings tab
  • – Routers..
  • + Enable Ignore automatically obtained routers
  • + Enable Use this connection only for resource on it’s network

:: Testing OpenVPN connection
From Server:


From Local or Client:


:: Links
+ Google
+ OpenVPN
+ Adeptus

Reset root password on CentOS 7

Edit boot menu on-the-go 0. reboot the CentOS 7 and press ESC when GRUB menu show up on the screen and press “e”1. find...
18 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *