Jump to content
Not connected, Your IP: 3.133.144.147
vpnps

Need optimal settings for fast reconnection

Recommended Posts

Hi, 
I am running a p2p service over vpn. I'd like to have a fast reconnection once the 24 disconnection by my ISP happens. Currently it takes about 1-2minutes after the reconnection to my ISP to establish a vpn connection again.
I am currently running with default settings from the generator with UDP 443.
 

client
dev tun
remote xyz123.airdns.org 443
resolv-retry infinite
nobind
persist-key
persist-tun
auth-nocache
verb 3
explicit-exit-notify 5
rcvbuf 262144
sndbuf 262144
push-peer-info
setenv UV_IPV6 yes
remote-cert-tls server
cipher AES-256-CBC
comp-lzo no
proto udp
key-direction 1


Are there ways to make the reconnection happen faster?

Thanks

Share this post


Link to post

Just out of curiosity, what's your ISP and country? A daily reconnect sounds very familiar to what Fritz!Box routers in Germany are configured to do on DSL by default, but that's not needed with most ISPs in Germany anymore. So if you're in Germany, you might as well disable that to fix this altogether if the ISP is right.

Otherwise, I'd probably drastically lower connection timeouts. The OpenVPN default is 120 seconds, AirVPN servers push 60, and you might be able to lower this to 10 or even 5 if you need. Pay some attention to your connections when setting this so low, as OpenVPN will forcibly reconnect, no matter if the line is under high load or it's really a disconnect. Add this to the config:

ping-restart 10

.

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post
Posted ... (edited)
12 hours ago, OpenSourcerer said:

Just out of curiosity, what's your ISP and country? A daily reconnect sounds very familiar to what Fritz!Box routers in Germany are configured to do on DSL by default, but that's not needed with most ISPs in Germany anymore. So if you're in Germany, you might as well disable that to fix this altogether if the ISP is right.
 

Well my ISP really has 24h reconnections and I rather want to set the time when that happens.
 
12 hours ago, OpenSourcerer said:

Otherwise, I'd probably drastically lower connection timeouts. The OpenVPN default is 120 seconds, AirVPN servers push 60, and you might be able to lower this to 10 or even 5 if you need. Pay some attention to your connections when setting this so low, as OpenVPN will forcibly reconnect, no matter if the line is under high load or it's really a disconnect. Add this to the config:

ping-restart 10


Thanks, I will give this a try and see whether and how often it reconnects due to high load. 
Does it make a difference to use udp or tcp regarding the reconnections?

I also sometimes have reconnections where the vpn connection is kept. How can this happen? Edited ... by vpnps

Share this post


Link to post
18 hours ago, vpnps said:

Does it make a difference to use udp or tcp regarding the reconnections?


I don't think so, and even if TCP was better, I'd strongly recommend staying on UDP because the performance is much better.
 
Quote

I also sometimes have reconnections where the vpn connection is kept. How can this happen?


How do you mean? Having reconnects while the VPN connection is kept is paradoxical :D

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post
Posted ... (edited)
5 hours ago, OpenSourcerer said:

 
How do you mean? Having reconnects while the VPN connection is kept is paradoxical :D
It certainly sounds strange but thats what sometimes happens. I have the 24h ISP disconnection and getting a new public ip but I keep the vpn connection alive. I don't know how that works. Edited ... by vpnps

Share this post


Link to post
14 hours ago, vpnps said:

I have the 24h ISP disconnection and getting a new public ip but I keep the vpn connection alive


If you don't get disconnected, chances are the IP remained the same.

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post
9 hours ago, OpenSourcerer said:

If you don't get disconnected, chances are the IP remained the same.
Nope, that's not the case. Thta's the first thing I checked :)
I get a new ipv4 and a new ipv6 prefix.

Share this post


Link to post
Posted ... (edited)
On 12/20/2020 at 12:50 AM, OpenSourcerer said:

So, does ping-restart work? :)

I added it to the ovpn file and restarted the service.
It didnt have any impact and took still almost a minute before it reconnect to the vpn server. It looks like that ping-restart is only server side? and is set to 60s?

And today was the first day where the client needed to reconnect to the vpn server. I still dont know how that worked without a connection loss on the other days. Edited ... by vpnps

Share this post


Link to post
12 hours ago, vpnps said:

It didnt have any impact and took still almost a minute before it reconnect to the vpn server.


Okay. Try this instead:

keepalive 5 10


It's short for ping 5, ping-restart 10. Maybe you need to lower the ping frequency, too.

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...