openvpn disconnect every ~2 minutes.

This forum is for admins who are looking to build or expand their OpenVPN setup.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
tontonjab
OpenVpn Newbie
Posts: 15
Joined: Sat Jul 24, 2021 4:13 pm

openvpn disconnect every ~2 minutes.

Post by tontonjab » Sat Jul 24, 2021 4:27 pm

Hello all, i dont know if its the right place to ask this, but... i am quite new in this and i need help...

I created a VPN server with this script:
https://github.com/angristan/openvpn-install

it works... but i have a huge problem now:

I have 2 systems like:
uname: Linux klk-fevo 4.14.9-klk #1 SMP Tue Feb 18 14:41:02 CET 2020 armv7l armv7l armv7l GNU/Linux

Server:
uname: Linux ns 5.8.0-43-generic #49-Ubuntu SMP Fri Feb 5 03:01:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Every two minutes, the connection drop. Like this:

Sat Jul 24 15:58:49 UTC 2021: 64 bytes from 10.8.0.5: icmp_seq=28 ttl=64 time=43.9 ms
Sat Jul 24 15:58:50 UTC 2021: 64 bytes from 10.8.0.5: icmp_seq=29 ttl=64 time=42.5 ms
-> DISCONNECT
Sat Jul 24 16:00:58 UTC 2021: 64 bytes from 10.8.0.5: icmp_seq=154 ttl=64 time=46.8 ms
Sat Jul 24 16:00:59 UTC 2021: 64 bytes from 10.8.0.5: icmp_seq=155 ttl=64 time=45.0 ms

or

Sat Jul 24 16:01:57 UTC 2021: 64 bytes from 10.8.0.9: icmp_seq=359 ttl=64 time=18.4 ms
Sat Jul 24 16:01:58 UTC 2021: 64 bytes from 10.8.0.9: icmp_seq=360 ttl=64 time=18.4 ms
-> DISCONNECT
Sat Jul 24 16:04:05 UTC 2021: 64 bytes from 10.8.0.9: icmp_seq=484 ttl=64 time=18.8 ms
Sat Jul 24 16:04:06 UTC 2021: 64 bytes from 10.8.0.9: icmp_seq=485 ttl=64 time=18.7 ms

So, i am quite now to all of this.
here the conf of the

CLIENT:
client
proto udp
explicit-exit-notify
remote 176.******** 1194
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_************** name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
ignore-unknown-option block-outside-dns
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3


SERVER:
port 1194
proto udp6
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 94.140.14.14"
push "dhcp-option DNS 94.140.15.15"
push "redirect-gateway def1 bypass-dhcp"
server-ipv6 fd42:42:42:42::/112
tun-ipv6
push tun-ipv6
push "route-ipv6 2000::/3"
push "redirect-gateway ipv6"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_*************.crt
key server_**************.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3
client-to-client
management 127.0.0.1 17562
verb 3
mute 20
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log

Thx you

tontonjab
OpenVpn Newbie
Posts: 15
Joined: Sat Jul 24, 2021 4:13 pm

Re: openvpn disconnect every ~2 minutes.

Post by tontonjab » Sat Jul 24, 2021 4:38 pm

I just want to add that, after few days, the connection i definitly lost. And i must to reboot.

User avatar
TinCanTech
Forum Team
Posts: 9668
Joined: Fri Jun 03, 2016 1:17 pm

Re: openvpn disconnect every ~2 minutes.

Post by TinCanTech » Sat Jul 24, 2021 5:44 pm

You need to read the answers provided here:
https://github.com/angristan/openvpn-in ... ter/FAQ.md

If that does not help then try adding this to your server config file:

Code: Select all

duplicate-cn

tontonjab
OpenVpn Newbie
Posts: 15
Joined: Sat Jul 24, 2021 4:13 pm

Re: openvpn disconnect every ~2 minutes.

Post by tontonjab » Sat Jul 24, 2021 5:47 pm

I am really sorry for that noob question. I checked the log ... and openvpn already said: add duplicate-cn.
Thx you for the confirmation.

Post Reply