# [FreeNAS] OpenVPN install issues



## demonLaMagra (Dec 24, 2013)

Hey guys, im I'm following this guide to install OpenVPN on my FreeNAS server http://joepaetzel.wordpress.com/2013/09 ... eenas-9-1/

I have run into the issues detailed below when trying to create the CA.cert.


```
[root@freenas] /mnt/NAS/openvpn# chmod -R 755 easy-rsa/2.0/*
[root@freenas] /mnt/NAS/openvpn# cd easy-rsa/2.0
[root@freenas] /mnt/NAS/openvpn/easy-rsa/2.0# sh
# ./clean-all
Please source the vars script first (i.e. "source ./vars")
Make sure you have edited it to reflect your configuration.
# . ./vars
NOTE: If you run ./clean-all, I will be doing a rm -rf on /mnt/NAS/openvpn/easy-rsa/2.0/keys
# ./build-ca
Please edit the vars script to reflect your configuration,
then source it with "source ./vars".
Next, to start with a fresh PKI configuration and to delete any
previous certificates and keys, run "./clean-all".
Finally, you can run this tool (pkitool) to build certificates/keys.
```

I have tried creating the keys directory manually as i've I've seen this has worked for some but still get the same output.

Any ideas will be appreciated.

cheers
Dan

UPDATE:

when trying to source ./vars i get the following.


```
[root@freenas] /mnt/NAS/openvpn/easy-rsa/2.0# source ./vars
export: Command not found.
export: Command not found.
export: Command not found.
export: Command not found.
EASY_RSA: Undefined variable.
export: Command not found.
EASY_RSA: Undefined variable.
```


----------



## DutchDaemon (Dec 24, 2013)

Disclaimer: PC-BSD DesktopBSD *FreeNAS* NAS4Free m0N0WALL pfSense ArchBSD kFreeBSD JabirOS topics


----------



## demonLaMagra (Dec 24, 2013)

Hi 

I have posted this on the FreeNAS website and no one seems to know  http://forums.freenas.org/threads/openv ... ues.17074/

*B*ecause *I* need a quick solution and FreeNAS is BSD based *I* thought maybe I could come and ask the question here where people may have more knowledge or work arounds to share. Sorry if *I* have broken any rules.

regards
Dan


----------



## DutchDaemon (Dec 24, 2013)

It is not about breaking rules (though we advise you read _all_ of them), it is about understanding that _any_ advice given here might render your FreeNAS installation unusable. Hence _disclaimer_.


----------



## demonLaMagra (Dec 24, 2013)

*O*kay   *I* understand that  

*I* think this is a general BSD question as *I* gather it is something I'm doing incorrectly in regards to working with BSD. My FreeNAS is not up and running fully yet and I wanted to get this sorted 1st first. If you have any suggestions on the problem *I* have it would be a great help  *W*illing to try anything at the moment, driving me crazy


----------



## ljboiler (Dec 24, 2013)

Running under sh (as you switched to prior to trying that `clean-all`), the proper syntax to "source" a file is just like you initially tried; source is the csh equivalent (those errors when you tried the `source` command tell me that it's expecting you to be doing this running under sh and not csh).  It's my guess that the `build-ca` command couldn't find something that it needed and therefore spit out that message about editing the vars script; I would look at that file and see if there are paths or files listed there that are in a different place on your system, make the appropriate edits, "source" it again, and retry the `build-ca`.

Good luck.


----------



## demonLaMagra (Dec 24, 2013)

ljboiler said:
			
		

> Running under sh (as you switched to prior to trying that `clean-all`), the proper syntax to "source" a file is just like you initially tried; source is the csh equivalent (those errors when you tried the `source` command tell me that it's expecting you to be doing this running under sh and not csh).  It's my guess that the `build-ca` command couldn't find something that it needed and therefore spit out that message about editing the vars script; I would look at that file and see if there are paths or files listed there that are in a different place on your system, make the appropriate edits, "source" it again, and retry the `build-ca`.
> 
> Good luck.



*N*o luck  *T*ried editing the paths in the ./vars file but nothing. *S*ure doesn*'*t help when you have no experience with BSD.


----------



## demonLaMagra (Dec 25, 2013)

*H*ey guys, *I* believe *I* have succeeded. It was all me doing something wrong :/ 

How do *I* confirm my *VPN* service is working??? *T*rying ifconfig but *I* can*'*t make out whether it*'*s working or not.

Cheers*.*


----------



## ljboiler (Dec 26, 2013)

You never said, but I assume you are trying to install an OpenVPN _server_ ?  The `netstat` command (`man netstat` for options) can show you what network ports have some service listening for connections; the standard port for OpenVPN is 1194 unless you have changed the configuration.


----------



## demonLaMagra (Dec 26, 2013)

I'm installing OpenVPN to make use of my VPN service. I have manage*d* to get OpenVPN to recognise my configuration file and CA from *m*y VPN servi*c*e provider but I can*'*t think of a way to see if it*'*s running.

I have run


```
netstat
Active Internet connections
Proto Recv-Q Send-Q Local Address          Foreign Address        (state)
tcp4       0      0 freenas.1078           SkyRouter.Home.64595   ESTABLISHED
tcp4       0      0 localhost.9042         localhost.63349        CLOSED
tcp4       0      0 localhost.9042         localhost.55076        CLOSED
```
 but it does not list anything from OpenVPN  

Cheers


----------



## kpa (Dec 26, 2013)

The correct command in FreeBSD to list listening sockets is sockstat(1). For example, `sockstat -l4` to list listening sockets that are listening for any IPv4 connections.


----------

