Based on FreeBSD, FreeNAS is a very popular open-source network storage and file serving that supports supports NFS (Unix file shares), SMB/CIFS (Windows file shares), AFP (Apple File Shares) FTP as well as iSCSI. FreeNAS is also compatible with a wide range of plugins, including: Bittorrent downloads, MiniDLNA, Plex Media Server, etc.
In this tutorial, we will show you how you can easily install OpenVPN on FreeNAS to secure your internet connection and maintain a private storage environment. Scroll down for more details.
Setting UP OpenVPN on FreeNAS
Follow the steps below to successfully install OpenVPN on FreeNAS. We will be using bVPN as an example of a VPN service provider for demonstration purposes.
1- Create Jail
This step is optional if you want to run OpenVPN in jail. In order to do this, you will need to first create jail by going to FreeNAS GUI. Click on “menu” and select “jail”, and then click on “Add jail”. Insert “bVPN” as a jail name.
2- Next, you will need to enable SSH. From “menu”, click on “Services”, and then check to turn SSH on. From the menu located on the left, click on “Services”, and then choose “SSH”. You must be sure to allow password login for root.
3- In this step, it is time to use SSH to your NAS. You can use Putty as an SSH client if you are using Windows or you can use Terminal as an SSH client if you are using Linux or Mac OS.
4- If you created jail (refer back to step 1), then enter it through this command:
jls
5- Find the JID for your jail. You can find the jail’s name under a column called “Hostname”:
jexec REPLACE WITH THE JID tcsh
6- Run the following command to download OpenVPN components:
pkg update && pkg upgrade && pkg install bash openvpn unzip curl
7- Run the following command to exist, and then enter jail once more:
exit
jexec REPLACE WITH THE JID tcsh
8- Enable “auto-start” through the following command:
echo 'openvpn_enable="YES"' >> /etc/rc.conf
echo 'openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf"' >> /etc/rc.conf
9- Import and download OpenVPN configuration files.
10- Insert your credentials to log in by running the command below:
echo "username" >> /usr/local/etc/openvpn/credentials
echo "CHANGE TO YOUR PASSWORD" >> /usr/local/etc/openvpn/credentials
11- Launch OpenVPN and make sure that all works properly through this command:
/usr/local/etc/rc.d/openvpn start
12- Wait for at least 30 seconds, and then run the following command to confirm that your connection is a success:
curl https://www.bvpn.com/v1/api/client/ptr
13- You should receive the following response:
{"status":true,"ip":"the external ip","ptr":"PTR for the IP address"}
Voila! You have successfully setup OpenVPN on FreeNAS. You can always contact your VPN administrator if you encounter any problems.
3 thoughts on “How to Install OpenVPN on FreeNAS”
Huawei y210-0100
very good app
please help wont let me set up openvpn
I honestly don’t get 9- Import and download OpenVPN configuration files. How do i do that? I’ve been searching the web for answer, but with no luck.