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
ifconfig 10.3.0.1 10.3.0.2
secret /etc/openvpn/shared.key
verb 3
mute 10
daemon

:: Starting OpenVPN Server in Ubuntu

/etc/init.d/openvpn start

:: Enable ip forwarding

vi /etc/sysctl.conf

Enable this line:

net.ipv4.ip_forward=1

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: 10.3.0.1
Local ip: 10.3.0.2

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:

ping 10.3.0.2

From Local or Client:

ping 10.3.0.1

:: Links
+ Google
+ OpenVPN
+ Adeptus

How to install NextCloud in Ubuntu 22.04

What’s NextCloud Nextcloud is an open-source software suite that offers a secure, self-hosted alternative to popular cloud storage and productivity platforms. With a focus...
sysadmin.id
8 min read

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....
sysadmin.id
18 sec read

Free ext4 reserved blocks with tune2fs

Check disk usage df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 95G 82G 7.9G 92% / Check size of Reserved block count...
sysadmin.id
19 sec read