Resource icon

Automatic install OpenVPN inside iocage Jail 2020-09-15

After having maintained a manual step-by-step tutorial, I decided to create a script to do all necessary steps for us all.

This script will:
- check for new version on each run and update itself
- create all dir structure and files on you
- store all configuration files into 'openvpn-configs'
- create iocage Jail with proper values and configurations
- build Certificate Authority
- build Server Certificates
- generate Diffie Hellman Parameters
- generate the TA key
- build Client(s) Certificate
- copy everything together and set paths to OpenVPN server config file
- creates the firewall and routing tables
- mix all certs and keys together with client(s) config files and create a single .ovpn file useful for mobile also.
- sends email with client(s) config file.

What you should do:
- edit the config file
- during the installation you'll be asked to create a PASS PHRASE which you'll be using to authorize further operations like generating certificates, keys, users
- forward chosen port (default 1194) to OpenVPN iocage Jail chosen IP (default .66) on Port 1194 UDP
- keep in mind that if your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x this might create routing conflicts if you connect to the VPN server from locations that use the same subnet (work, public wi-fi, hotels, etc).

Installation steps:

SSH into Freenas

ssh your-username@your-FreeNAS-IP # Terminal for MacOS & Linux or Putty on Windows
sudo -i # we need to be root

Download installer
git clone
cd OpenVPN-on-FreeNAS-in-iocage # Enter the script dir

Start installer and follow on-screen instructions
./ # run the script and enters the menu

View attachment 38331
First release
Last update
0.00 star(s) 0 ratings