Page 1 of 1

Disable auto reconnect - Set automatic disconnect

Posted: Mon Feb 17, 2014 3:55 am
by shannonho
Hi,

Is there anyway to:

1.Set a timeout so that if a user remains idle on their connection for a set amount of time they will be disconnected from the OpenVPN service.
2. Make OpenVPN not connect automatically after computer wakes from sleep or the computer turns on, so if user forgets to disconnect their session they are not automatically reconnected when they turn their computers on again.

Thank You.

Re: Disable auto reconnect - Set automatic disconnect

Posted: Tue Feb 18, 2014 4:02 pm
by aschmocker
Where i have to set the --inactive n option? Is there a config file? :?:

Re: Disable auto reconnect - Set automatic disconnect

Posted: Wed Feb 19, 2014 8:33 am
by aschmocker
I am using Access Server version: 2.0.3 (Appliance with update) on Ubuntu 13.10

Re: Disable auto reconnect - Set automatic disconnect

Posted: Wed Feb 26, 2014 5:19 am
by shannonho
Thank you debbie10t.

Unfortuantely that does not appear to be doing anything. Can you have a look at my settings and let me know if it is a simple syntax error?

In "Advanced VPN" Under "Client Config Directives" I entered: "--inactive 300 [51200]"

I also tried:
"--inactive 300 51200"
"--inactive 300 [51200]"
"inactive 300 [51200]"

Without the quotes of course.

To my understanding the above settings should make the OpenVPN client disconnect after 5 minutes of activity if less than <50Kb was transmitted. Am I correct on this?

Thank You.

Re: Disable auto reconnect - Set automatic disconnect

Posted: Wed Feb 26, 2014 9:33 pm
by shannonho
Thank You Debbie. That appears to be working to disconnect clients after 5 minutes with less than 50Kb transferred but they automatically reconnect straight away. Any idea why this might be?

Thank You,

Shannon

Re: Disable auto reconnect - Set automatic disconnect

Posted: Thu Mar 06, 2014 1:53 am
by shannonho
The problem with Access Server is that the keepalive directive is buried somewhere in the appliance, appears no option via the webadmin client to disable it. So when you try to set ping-exit it conflicts with keepalive. Of course keepalive is setting ping-restart when we want ping-exit.

Error:
process started and then immediately exited: ["Options error: --keepalive conflicts with --ping, --ping-exit, or --ping-restart. If you use --keepalive, you don't need any of the other --ping directives."]
service failed to start or returned error status
process started and then immediately exited: ["Options error: --keepalive conflicts with --ping, --ping-exit, or --ping-restart. If you use --keepalive, you don't need any of the other --ping directives."]
service failed to start or returned error status

Is there a way I can dig into the appliance VM and remove the default keepalive setting?

Re: Disable auto reconnect - Set automatic disconnect

Posted: Tue Feb 23, 2016 7:50 pm
by davidc
Seems like the answers I need got deleted. How can I configure OpenVPNAS to disconnect VPN clients after inactivity?

Thank you very much!

Re: Disable auto reconnect - Set automatic disconnect

Posted: Wed Feb 24, 2016 2:15 am
by Traffic
Access server support: here.

Re: Disable auto reconnect - Set automatic disconnect

Posted: Tue May 15, 2018 1:04 pm
by gazmoid
Hi there i would really like to know the answer to this but the reply has been deleted and the help search functionality doesn't let you search for 'auto disconnect' because apparently its too common a term!!!

Please can you post the answer

Re: Disable auto reconnect - Set automatic disconnect

Posted: Wed May 16, 2018 12:46 pm
by novaflash
Maybe this is what you are looking for.
https://docs.openvpn.net/command-line/o ... _threshold

Re: Disable auto reconnect - Set automatic disconnect

Posted: Sat Jan 22, 2022 12:08 am
by joeytian
Did you get solution? I have the same issue too, want to disable the auto reconnect. Auto reconnect is convenient for most of the cases but not always, I need manually to click "reconnect" to continue after it disconnected/lost Internet or so.

Re: Disable auto reconnect - Set automatic disconnect

Posted: Sat Jan 22, 2022 12:11 am
by joeytian
novaflash wrote:
Wed May 16, 2018 12:46 pm
Maybe this is what you are looking for.
https://docs.openvpn.net/command-line/o ... _threshold
This is NOT the case, at least not me.