Step by step to install OpenVPN inside a Jail in FreeNAS 11.1-U1

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Aaaa, there is on more important thing... LAN from your FreeNAS network and LAN from where you want to connect, should be different otherwise they conflict.
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
Hello Bibi40k
i have a problem may be about jail's network
i follow the guide step by step
but i cant connect to the OVPN service
OVPN is working
port is forwarding
Lan ip is good
but i can only telnet the ovpn's port in the jail
from outside, it is said "connection refused"
Ovpn client is keep loading at all, looks like it cant connect to server.
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Hi,
i know about this behaviour, it seems there is a problem with Iocage.
I'm working on a script to automate installing it (90% ready) and i hope i'll found the solution.
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
Hi,
i know about this behaviour, it seems there is a problem with iocage.
I'm working on a script to automate installing it (90% ready) and i hope i'll found the solution.
it is hard to do something...
i have spend three whole day for reinstalling, fixing, finding posts
but it still happens
and just now, i cant telnet it in the jail anymore... Worst
i wish you can finish your work without any problem from now and find out where is the problem :)
 

Dopamin3

Dabbler
Joined
Aug 18, 2017
Messages
46
Hello Bibi40k
i have a problem may be about jail's network
i follow the guide step by step
but i can't connect to the OVPN service
OVPN is working
port is forwarding
Lan IP is good
but i can only telnet the ovpn's port in the jail
from outside, it is said "connection refused"
Ovpn client is keep loading at all, looks like it can't connect to server.

Did you try rebooting the entire FreeNAS? I needed to do that to first get it working. Also need to do it sometimes when upgrading the jail.
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
Did you try rebooting the entire FreeNAS? I needed to do that to first get it working. Also need to do it sometimes when upgrading the jail.
i have restart the jail, the Freenas system for many times. i can't even count it :( ..
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Hi, all
i have released first public version of the script and created a new topic.

See you there

 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
installed, thank you!!
but now another problem, my client always said that "given private key password does not allow for correct decryption"...
anyways to fix it?
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Well,
there are a lot o variables that can affect proper functionality of OpenVPN system and you did not offer us anything, not even your FreeNAS version.

Anyway, i created that script and share it to public.

All you need to do is to iocage destroy <old_ovpn> and then use that script
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
Well,
there are a lot o variables that can affect proper functionality of OpenVPN system and you did not offer us anything, not even your FreeNAS version.

Anyway, i created that script and share it to public.

All you need to do is to iocage destroy <old_ovpn> and then use that script
Sorry for not offering details.
like i said in #224:
"i can't connect to the OVPN service
OVPN is working
port is forwarding
Lan IP is good
but i can only telnet the ovpn's port in the jail
from outside, it is said "connection refused"

Ovpn client is keep loading at all, looks like it can't connect to server. "
After this, I wait for your script. Till today, i try to use the script for installing. But still the same problem, can't connect to OVPN server.
FreeNAS: 11.2U7
OVPN: (your script)
Port: the script make it 1194
The Freenas version i type while using the script is 11.2

And also the script send my mail to me@example.com though i have input the email. = =

Please tell me if you want any information.
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Hi,

"Port: the script make it 1194": you can change it but you need to add it to your router

"And also the script send my mail to me@example.com though i have input the email. = =" - please rerun the script and it will send to your real address. I need to fix this but it should do the job at second run.
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
Hi,

"Port: the script make it 1194": you can change it but you need to add it to your router

"And also the script send my mail to me@example.com though i have input the email. = =" - please rerun the script and it will send to your real address. I need to fix this but it should do the job at second run.
Port is change by the script, i have typed 9000.
Then the problem about connection is still there...
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
9000 would be external port that you should forward to local-openvpn-jail-IP:1194
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Of course you get nothing as long as you try to telnet to FreeNAS instead of OpenVPN jail
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
Of course you get nothing as long as you try to telnet to FreeNAS instead of OpenVPN jail
Humm.. Of course i do it inside the jail. And also outside, both get nothing. But „sockstat -4 -l“ shows that OVPN is listening on 1194 udp
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
„sockstat -4 -l“ shows that OVPN is listening on 1194 udp ... which is good.

Testing UDP port connectivity wit nc command
The syntax to test UDP port connectivity with nc command is as follows:

# nc -z -v -u [hostname/IP address] [port number]
Example of successful connection:

# nc -z -v -u 192.168.10.12 123
Connection to 192.118.20.95 123 port [udp/ntp] succeeded!



what is your problem ?
 

Iong Wong

Dabbler
Joined
Feb 15, 2020
Messages
13
„sockstat -4 -l“ shows that OVPN is listening on 1194 udp ... which is good.

Testing UDP port connectivity wit nc command
The syntax to test UDP port connectivity with nc command is as follows:

# nc -z -v -u [hostname/IP address] [port number]
Example of successful connection:

# nc -z -v -u 192.168.10.12 123
Connection to 192.118.20.95 123 port [udp/ntp] succeeded!



what is your problem ?
Really sorry that i am a noob to these.
the problem now i have is: I can connect to the server, but OVPN client said that the public IP has not been changed. (Also checked by myself)
I checked the connection status. The LAN IP which server given is 10.8.0.6, I think that the server is working. But looks like packages are not going to the server. (I have changed the network I use. Data and Office, same problem.)
I don't know how to deal with that now...
Please help me
 
Top