OpenVPN setup guide for FreeNAS 11.2

JTBTek

Dabbler
Joined
Dec 1, 2018
Messages
32
There are a bunch of post for that issue. Just search the forum for "failed to start openvpn", you will find several that are marked solved. Search and the freenas documents are your friend.
 

saviodesign

Dabbler
Joined
Apr 7, 2017
Messages
21
Hi, I was looking into access FreeNAS throut OpenVPN found this but I can't even install pkg nano or pkg openvpn it saids No packages available to install matching either or. I did this but still no luck there is more than 10 Forum that exlplain how to install openvpn but not 1 work and most of them is the same reason NO SUCH DIRECTORY OR FILE/NO PACKAGES AVAILABLE.

It most be a bug in FreeNAS 11.2 because not even nextcloud works properly!


Check your network connections.
e.g. ping google.com

Once they are fixed you should be golden!
 

onthax

Explorer
Joined
Jan 31, 2012
Messages
81
i was having the same issue.

resolved with

pkg update -f

then tried pkg install openvpn

works now.
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
So I just tested these steps in 11.2-RELEASE-U1, It does still work.

Maybe I didn't type it clear. These steps need to be performed inside the transmission jail.

Navigate to freenas shell

iocage console transmission

ee /usr/local/etc/pkg/repos/FreeBSD.conf

Change no to yes

Esc and save

pkg update

Now you can install your packages

Edit-Also verified the reboot is not necessary.

I also tried this in the latest version of FreeNAS (as of today), and it does not work for me.
Main problem is the file you mention doesn't exist in the jail, so I'm at a loss for what you might be editing. Given that it doesn't exist, it's impossible to create it with your vague instruction to "Change no to yes". Can you provide the actual file contents for the rest of us.
 

onthax

Explorer
Joined
Jan 31, 2012
Messages
81
file exists for me

in vi looks like:

Code:
FreeBSD: { enabled: yes }


/usr/local/etc/pkg/repos/FreeBSD.conf: unmodified: line 1

make sure your in your jail tho, the same file exists in your freenas root.
 

VolumeTank

Dabbler
Joined
Dec 23, 2018
Messages
38
So I just tested these steps in 11.2-RELEASE-U1, It does still work.

Maybe I didn't type it clear. These steps need to be performed inside the transmission jail.

Navigate to freenas shell

iocage console transmission

ee /usr/local/etc/pkg/repos/FreeBSD.conf

Change no to yes

Esc and save

pkg update

Now you can install your packages

Edit-Also verified the reboot is not necessary.


I give up for some reason every time I get stuck on one step further lol now I can't pass this:

Code:
Once Nano opens, type in your PIA username and password in two lines, with no other content:

p1234567
exam.ple.pass.word
Hit Ctrl-O then Enter to save, then Ctrl-X to close the password file.

Next, open the openvpn.conf file that you moved here in Nano so we can edit it:

nano openvpn.conf
Nano will pop up, containing the OpenVPN configuration settings. Edit the ca, auth-user-pass, and crl-verify lines to point to the files we created:

ca /usr/local/etc/openvpn/ca.crt

auth-user-pass /usr/local/etc/openvpn/pass.txt

crl-verify /usr/local/etc/openvpn/crl.pem
 

VolumeTank

Dabbler
Joined
Dec 23, 2018
Messages
38
Edit: Sorry misread who was posting

What are you having trouble with in this section?
I'm not sure what it means:
type in your PIA username and password in two lines, with no other content

Also when I get to this:
nano openvpn.conf

Nothing shows up
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
file exists for me

in vi looks like:

Code:
FreeBSD: { enabled: yes }


/usr/local/etc/pkg/repos/FreeBSD.conf: unmodified: line 1

make sure your in your jail tho, the same file exists in your freenas root.

It's missing from ALL my jails. Does exist in root.
 

onthax

Explorer
Joined
Jan 31, 2012
Messages
81
It's missing from ALL my jails. Does exist in root.

Not sure, you could try adding it manually, but it suggests there is something wrong with your build.
unfortunately beyond my freebsd knowledge, maybe start a new thread about this problem so you can get more FreeBSD/OS attention rather than in plugins?
 

onthax

Explorer
Joined
Jan 31, 2012
Messages
81
I'm not sure what it means:
type in your PIA username and password in two lines, with no other content

Also when I get to this:
nano openvpn.conf

Nothing shows up

the part you are missing is here:

Code:
Download the configuration from your VPN provider and extract all files to the openvpn folder (SMB share)
/usr/local/etc/openvpn/ 


the openvpn.conf gets downloaded from your vpn provider and contains all the config for your vpn to work with them.
it doesn't auto exist.

for me, i downloaded my openvpn conf from my provider then renamed to openvpn.conf.

then i edited it to add the line

Code:
auth-user-pass /usr/local/etc/openvpn/pass.txt


in this file i created

Code:
username
password
 

VolumeTank

Dabbler
Joined
Dec 23, 2018
Messages
38
the part you are missing is here:

Code:
Download the configuration from your VPN provider and extract all files to the openvpn folder (SMB share)
/usr/local/etc/openvpn/ 


the openvpn.conf gets downloaded from your vpn provider and contains all the config for your vpn to work with them.
it doesn't auto exist.

for me, i downloaded my openvpn conf from my provider then renamed to openvpn.conf.

then i edited it to add the line

Code:
auth-user-pass /usr/local/etc/openvpn/pass.txt


in this file i created

Code:
username
password

No sure if I understand, but why would I need a VPN provider when the whole idea is to set OpenVPN as a server on the FreeNAS Jail not as a client. That wouldn't work to access the FreeNAS remotely, I did something similar by installing Open VPN as a client on the Router itself but it does not work. I did got it to work setting the router as a server then connect my laptop as client from outside of my home network and connected remotely through smb on the FreeNAS. So far I've test with my cellphone hotspot which is obviously a very slow connection. I have to try from a LAN connection outside of my home network to see.

Honestly I think that the best way will always be PORT FORWARDING with the down side of security issues.
 

onthax

Explorer
Joined
Jan 31, 2012
Messages
81
No sure if I understand, but why would I need a VPN provider when the whole idea is to set OpenVPN as a server on the FreeNAS Jail not as a client. That wouldn't work to access the FreeNAS remotely, I did something similar by installing Open VPN as a client on the Router itself but it does not work. I did got it to work setting the router as a server then connect my laptop as client from outside of my home network and connected remotely through smb on the FreeNAS. So far I've test with my cellphone hotspot which is obviously a very slow connection. I have to try from a LAN connection outside of my home network to see.

Honestly I think that the best way will always be PORT FORWARDING with the down side of security issues.

Ahh i think the purpose of this guide is setting up the client so all the jail traffic goes out via the VPN.
Not sure on setting it up as a server. but that might be why you are struggling with the guide.

New thread maybe?
 
Top