#1 2019-02-23 07:49:19

Hasdump
Trusted Member
Registered: 2019-02-23
Posts: 7

[MrVm] Need some help setting up OpenVPN

Few days ago I bought a NAT VPS from MrVM and have been kind of confused in setting up Nyr's OpenVPN script.
I used to use this script on other VPS's and it was a not that hard.

Sat Feb 23 14:46:42 2019 OpenVPN 2.4.6 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 26 2018
Sat Feb 23 14:46:42 2019 Windows version 6.2 (Windows 8 or greater) 64bit
Sat Feb 23 14:46:42 2019 library versions: OpenSSL 1.1.0h  27 Mar 2018, LZO 2.10
Sat Feb 23 14:46:42 2019 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Sat Feb 23 14:46:42 2019 Need hold release from management interface, waiting...
Sat Feb 23 14:46:43 2019 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Sat Feb 23 14:46:43 2019 MANAGEMENT: CMD 'state on'
Sat Feb 23 14:46:43 2019 MANAGEMENT: CMD 'log all on'
Sat Feb 23 14:46:43 2019 MANAGEMENT: CMD 'echo all on'
Sat Feb 23 14:46:43 2019 MANAGEMENT: CMD 'bytecount 5'
Sat Feb 23 14:46:43 2019 MANAGEMENT: CMD 'hold off'
Sat Feb 23 14:46:43 2019 MANAGEMENT: CMD 'hold release'
Sat Feb 23 14:46:43 2019 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sat Feb 23 14:46:43 2019 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sat Feb 23 14:46:43 2019 TCP/UDP: Preserving recently used remote address: [AF_INET]172.xx.xx.xxx:xxx09
Sat Feb 23 14:46:43 2019 Socket Buffers: R=[65536->65536] S=[65536->65536]
Sat Feb 23 14:46:43 2019 UDP link local: (not bound)
Sat Feb 23 14:46:43 2019 UDP link remote: [AF_INET]172.xx.xx.xxx:xxx09
Sat Feb 23 14:46:43 2019 MANAGEMENT: >STATE:1550908003,WAIT,,,,,,
Sat Feb 23 14:49:54 2019 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sat Feb 23 14:49:54 2019 TLS Error: TLS handshake failed

Im sure TUN/TAP is already enabled on the cp.
Any advices would be appreciated as I'm trying to learn Linux OS too.

Last edited by Hasdump (2019-02-23 07:50:39)

Offline

#2 2019-02-23 08:10:10

AnthonySmith
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,936
Website

Re: [MrVm] Need some help setting up OpenVPN

I advise setting it up manually or using someone else’s script as Nyr has not maintained that one for LES use in 4 plus years


https://upto32.com retro gaming and nostalgia forum that does not take itself to seriously smile

Offline

#3 2019-02-23 08:24:36

Hasdump
Trusted Member
Registered: 2019-02-23
Posts: 7

Re: [MrVm] Need some help setting up OpenVPN

Used Angristan's script and the same problem still persist, seems like I can't reach the VPS.
Maybe I have set the port Incorrectly or something else
*Currently set the openvpn to 21209 UDP, not sure if this is correct usage
**Update, Not sure if this helps https://i.imgur.com/EuS8Dd1.png Seems OpenVPN wont listen to the port?

Last edited by Hasdump (2019-02-23 09:14:35)

Offline

#4 2019-02-23 16:10:46

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

Does your internal IP end with 212?

Offline

#5 2019-02-23 17:10:40

Hasdump
Trusted Member
Registered: 2019-02-23
Posts: 7

Re: [MrVm] Need some help setting up OpenVPN

Yes, my Primary IP ends with 212 and its been described in the email I can use port 21201 - 21220.
Not sure if im using it correctly though

Offline

#6 2019-02-23 18:09:09

wcypierre
Trusted Member
Registered: 2013-08-07
Posts: 65

Re: [MrVm] Need some help setting up OpenVPN

on the connectivity issue, I would like to chip in as well as the sg node had the same issue (unable to query localhost port 19999 but it is fine now

Offline

#7 2019-02-24 12:44:38

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

wcypierre wrote:

on the connectivity issue, I would like to chip in as well as the sg node had the same issue (unable to query localhost port 19999 but it is fine now

 
If you query localhost from the inside of the container, it never goes outside of your container.
That port is not forwarded so any connectivity issues would have been inside your container.

Offline

#8 2019-02-24 12:46:56

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

Hasdump wrote:

**Update, Not sure if this helps https://i.imgur.com/EuS8Dd1.png Seems OpenVPN wont listen to the port?

Run a netstat and see what ports/services are running/listening.

Offline

#9 2019-02-24 13:03:04

Hasdump
Trusted Member
Registered: 2019-02-23
Posts: 7

Re: [MrVm] Need some help setting up OpenVPN

The running ports/services are
ssh, https, smtp

Also, got this from syslog. TUN/TAP is already enabled on web CP, if theres a manual way doing it. I'll try that

Feb 24 07:56:02 the1337 ovpn-server[3919]: ERROR: Cannot open TUN/TAP dev /dev/net/tun: Operation not permitted (errno=1)
Feb 24 07:56:02 the1337 ovpn-server[3919]: Exiting due to fatal error
Feb 24 07:56:02 the1337 systemd[1]: [email protected]: main process exited, code=exited, status=1/FAILURE
Feb 24 07:56:02 the1337 systemd[1]: Unit [email protected] entered failed state.


[email protected]:~# cat /dev/net/tun
cat: /dev/net/tun: Operation not permitted

*Update, tried reinstalling debian but still get errno=1
also tried installing ubuntu and still getting errno=1

Last edited by Hasdump (2019-02-24 15:20:07)

Offline

#10 2019-02-24 17:42:24

Hasdump
Trusted Member
Registered: 2019-02-23
Posts: 7

Re: [MrVm] Need some help setting up OpenVPN

Problem Solved
Huge thanks to Mikho for the helps!

Offline

#11 2019-02-25 01:05:19

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

Was it the stop/start from the control panel that solved it?

Offline

#12 2019-02-25 04:00:55

Hasdump
Trusted Member
Registered: 2019-02-23
Posts: 7

Re: [MrVm] Need some help setting up OpenVPN

Yes, stopping and starting the server through the web CP fixed the TUN/TAP problem. The /dev/net/tun is there, just not accessible (errno=1).
Stopping it then Starting the server fixes it and tun0 works.

>openvpn service started on the vps, but failed to use tun0 (errno=1)
>stopped the server (not reboot/shutdown option)
>started the server (not reboot/shutdown option)
>openvpn server automaticly starts and tun0 is usable

**+Also a question, is the 300GB Transfer quota Monthly or Yearly?**

Last edited by Hasdump (2019-02-25 04:53:22)

Offline

#13 2019-02-25 08:55:08

AnthonySmith
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,936
Website

Re: [MrVm] Need some help setting up OpenVPN

I don't know why virtualizor don't just put the same function in to the reboot button for re-writing the config file, would make life so much easier!

To much common sense I guess. smile


https://upto32.com retro gaming and nostalgia forum that does not take itself to seriously smile

Offline

#14 2019-02-25 11:14:52

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

Hasdump wrote:

**+Also a question, is the 300GB Transfer quota Monthly or Yearly?**

Monthly

Offline

#15 2019-02-25 11:15:53

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

AnthonySmith wrote:

I don't know why virtualizor don't just put the same function in to the reboot button for re-writing the config file, would make life so much easier!

To much common sense I guess. smile

 
Was the same thing with Solus not long ago. 
Had to stop/start the container from the control panel to make some changes stick.

Offline

#16 2019-02-25 12:48:00

AnthonySmith
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,936
Website

Re: [MrVm] Need some help setting up OpenVPN

yeah its confusing.

SolusVM rewrites the config file when you hit reboot, it does not when you shutdown then boot, however in order for the driver to work properly the container needs to stop not just reboot.

Virtualizor only rewrites the config file when you stop the container then start it and not when you hit reboot so people enable it and hit reboot instead of stop/start.

you would think between them they would have sorted this out by now haha.


https://upto32.com retro gaming and nostalgia forum that does not take itself to seriously smile

Offline

#17 2019-02-25 20:56:11

WSS
Trusted Member
Registered: 2016-12-22
Posts: 451

Re: [MrVm] Need some help setting up OpenVPN

I guess I'm the only one who gets sick of rebooting (containers) all of the time so I use vzctl?

Last edited by WSS (2019-02-25 20:56:25)


RbyeR4Nm.png

Offline

#18 2019-02-26 14:21:36

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

WSS wrote:

I guess I'm the only one who gets sick of rebooting (containers) all of the time so I use vzctl?

That you can do if you have access to the node smile not as a customer

Offline

#19 2019-02-26 14:51:17

WSS
Trusted Member
Registered: 2016-12-22
Posts: 451

Re: [MrVm] Need some help setting up OpenVPN

mikho wrote:
WSS wrote:

I guess I'm the only one who gets sick of rebooting (containers) all of the time so I use vzctl?

That you can do if you have access to the node smile not as a customer

Or so they would have you believe.   big_smile

Both popular solutions are pretty buggy, but I haven't had much play with Virtualizor admin to date.  It can't be that much worse than SVM- I mean that would be impossible.


RbyeR4Nm.png

Offline

#20 2019-02-27 02:28:56

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

Clickety-clickety-click

Bunch of clicks everywhere.

Offline

#21 2019-02-28 13:48:40

mdoerges
Trusted Member
Registered: 2014-11-10
Posts: 9

Re: [MrVm] Need some help setting up OpenVPN

I have the same problem on my Norway 1GB NAT VPS. The tun device isn't working.
Internal IPv4: 172.16.41.106
OpenVPN  shows an error:

ERROR: Cannot open TUN/TAP dev /dev/net/tun: Operation not permitted (errno=1)

Tried to disable/enable the tun device. Also tried to shutdown and start the VPS (not rebooting). Still not working.
Can you please check?

Offline

#22 2019-02-28 19:44:57

WSS
Trusted Member
Registered: 2016-12-22
Posts: 451

Re: [MrVm] Need some help setting up OpenVPN

@mikho
for n in `vzlist -S -Ho ctid`;do sudo vzctl set "$n" --devnodes net/tun:rw --save;done


RbyeR4Nm.png

Offline

#23 2019-03-05 10:34:34

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,715
Website

Re: [MrVm] Need some help setting up OpenVPN

mdoerges wrote:

I have the same problem on my Norway 1GB NAT VPS. The tun device isn't working.
Internal IPv4: 172.16.41.106
OpenVPN  shows an error:

ERROR: Cannot open TUN/TAP dev /dev/net/tun: Operation not permitted (errno=1)

Tried to disable/enable the tun device. Also tried to shutdown and start the VPS (not rebooting). Still not working.
Can you please check?


Sorry, totally missed this reply.

Please check now
Or stop and start from client panel

Offline

Board footer

Powered by FluxBB