Thanks so much for this tutorial! After many hours of playing with this under Freenas 11.2, I got it working!
Here are my tips (YMMV):
For the commands executed within the jail under iocage to get in it's:
Code:
iocage console <jail name>
To get OpenVPN to run under iocage with default settings ("cannot create TAP dynamically" exit error) I had to run from the NAS host (not within the jail):
Code:
iocage stop <jail-name>
iocage set allow_tun=1 <jail-name>
iocage start <jail-name>
Connecting to the VPN required two things:
Code:
#Server Config File at the very top
local <IP address of the jail>
And:
Code:
#In the client config file set the port number = the server port number
remote <your internet domain or public (static) IP> 1194 #instead of 443
(not sure if this was completely necessary)
In order to test the connection I found I could not connect from within the network on my PC for some reason. Instead, I used the OpenVPN connect app under iOS. To load the files, connect the phone to iTunes, go to File Sharing then click on the OpenVPN app and upload the files there. Profile pops up in the app and all is good.
Obviously I had to forward the appropriate ports in my router/firewall as well. Hopefully this helps someone; overall the process is straightforward enough hopefully someone can come up with a working plugin instead.
Oh and the email thing didn't work for me either for some reason. Rather than tracking down the issue I just (in the Freenas GUI) stopped the jail, added a NAS mount point on a shared directory, and copied the files from there.