Disable auto reconnect - Set automatic disconnect

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
shannonho
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 17, 2014 3:07 am

Disable auto reconnect - Set automatic disconnect

Post by shannonho » Mon Feb 17, 2014 3:55 am

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.

aschmocker
OpenVpn Newbie
Posts: 2
Joined: Tue Jan 21, 2014 8:24 am

Re: Disable auto reconnect - Set automatic disconnect

Post by aschmocker » Tue Feb 18, 2014 4:02 pm

Where i have to set the --inactive n option? Is there a config file? :?:

aschmocker
OpenVpn Newbie
Posts: 2
Joined: Tue Jan 21, 2014 8:24 am

Re: Disable auto reconnect - Set automatic disconnect

Post by aschmocker » Wed Feb 19, 2014 8:33 am

I am using Access Server version: 2.0.3 (Appliance with update) on Ubuntu 13.10

shannonho
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 17, 2014 3:07 am

Re: Disable auto reconnect - Set automatic disconnect

Post by shannonho » Wed Feb 26, 2014 5:19 am

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.

shannonho
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 17, 2014 3:07 am

Re: Disable auto reconnect - Set automatic disconnect

Post by shannonho » Wed Feb 26, 2014 9:33 pm

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

shannonho
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 17, 2014 3:07 am

Re: Disable auto reconnect - Set automatic disconnect

Post by shannonho » Thu Mar 06, 2014 1:53 am

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?

davidc
OpenVpn Newbie
Posts: 1
Joined: Tue Feb 23, 2016 7:40 pm

Re: Disable auto reconnect - Set automatic disconnect

Post by davidc » Tue Feb 23, 2016 7:50 pm

Seems like the answers I need got deleted. How can I configure OpenVPNAS to disconnect VPN clients after inactivity?

Thank you very much!

User avatar
Traffic
OpenVPN Protagonist
Posts: 4081
Joined: Sat Aug 09, 2014 11:24 am

Re: Disable auto reconnect - Set automatic disconnect

Post by Traffic » Wed Feb 24, 2016 2:15 am

Access server support: here.

gazmoid
OpenVpn Newbie
Posts: 1
Joined: Tue May 15, 2018 12:59 pm

Re: Disable auto reconnect - Set automatic disconnect

Post by gazmoid » Tue May 15, 2018 1:04 pm

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

User avatar
novaflash
OpenVPN Inc.
Posts: 1070
Joined: Fri Apr 13, 2012 8:43 pm

Re: Disable auto reconnect - Set automatic disconnect

Post by novaflash » Wed May 16, 2018 12:46 pm

Maybe this is what you are looking for.
https://docs.openvpn.net/command-line/o ... _threshold

joeytian
OpenVpn Newbie
Posts: 2
Joined: Sat Jan 22, 2022 12:06 am

Re: Disable auto reconnect - Set automatic disconnect

Post by joeytian » Sat Jan 22, 2022 12:08 am

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.
Last edited by joeytian on Sat Jan 22, 2022 12:14 am, edited 1 time in total.

joeytian
OpenVpn Newbie
Posts: 2
Joined: Sat Jan 22, 2022 12:06 am

Re: Disable auto reconnect - Set automatic disconnect

Post by joeytian » Sat Jan 22, 2022 12:11 am

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.

Post Reply