You’ve set up an OpenVPN server on pfSense or some other router/gateway and you have a remote server you’d like to connect back to the private network. Here’s how you do it.
First, let’s get it installed:
# sudo apt update && apt upgrade -y # sudo apt install openvpn
Copy/paste your client configuration from your server place it in /etc/openvpn/nameofserver.config
# sudo nano /etc/openvpn/nameofserver.config
Change the line that reads
Let’s put your username and password in there:
# sudo nano /etc/openvpn/pass
Line 1 should be the username, line 2 should be the password.
Save it. Next, enable the service with your particular connection:
# systemctl enable openvpn@nameofserver # systemctl start openvpn@nameofserver
You should be able to see a tunnel connection now:
# ip a 3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100 link/none inet 192.168.1.3/24 brd 192.168.1.255 scope global tun0 valid_lft forever preferred_lft forever
All set. For setting up a server, see the following: