Turn Off VPN when VPN Server is not reachable in iOS 8

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
sumaiay
OpenVpn Newbie
Posts: 4
Joined: Wed Dec 10, 2014 7:08 am

Turn Off VPN when VPN Server is not reachable in iOS 8

Post by sumaiay » Wed Dec 10, 2014 7:15 am

Hi,

I am facing an issue where VPN tries connecting when VPN server is down infinitely, for which i did some VPN payload changes

connect-timeout 30
connect-retry 600
connect-retry-max 1
resolv-retry 0

Even after doing these changes when VPN Server is down my normal internet goes for a toss and does not turn on for 120 seconds.
Where is it takes timeout of 60 seconds and tries twice after 5 seconds of gap.

Can someone give me a solution of disconnecting VPN after 30 seconds timeout in iOS 8?? As iOS 7 i have no issue of disconnecting with these payload settings.

Tried On Demand rules - Disconnect.
http://stackoverflow.com/questions/2507 ... os-6-ios-7

Any help is appreciated.

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

Re: Turn Off VPN when VPN Server is not reachable in iOS 8

Post by Traffic » Wed Dec 10, 2014 12:19 pm

Depending on the protocol you use:

Client Config
  • TCP:
    • connect-retry 5
      connect-retry-max 6 ## 6 retries times 5 seconds = 30 seconds
    UDP:
    • ping 5
      ping-exit 30 ## exit after 30 seconds of no pings .. do not use --ping-remote in your config.
You may have to remove --keepalive from the server config as it will override client settings once connected.

sumaiay
OpenVpn Newbie
Posts: 4
Joined: Wed Dec 10, 2014 7:08 am

Re: Turn Off VPN when VPN Server is not reachable in iOS 8

Post by sumaiay » Thu Dec 11, 2014 12:22 pm

Hey, Thanks for your response!
I really appreciate.

But my problem is not yet resolved still. After doing the following changes what you mentioned still by default VPN takes 60 seconds timeout with 2 tries totally 120 seconds and the main issue here till then i will not be able to access normal internet.

sumaiay
OpenVpn Newbie
Posts: 4
Joined: Wed Dec 10, 2014 7:08 am

Re: Turn Off VPN when VPN Server is not reachable in iOS 8

Post by sumaiay » Thu Dec 11, 2014 12:24 pm

Hey, Thanks for your response!
I really appreciate.

But my problem is not yet resolved still. After doing the following changes what you mentioned still by default VPN takes 60 seconds timeout with 2 tries totally 120 seconds and the main issue here till then i will not be able to access normal internet.
Have also set keep alive on server configuration as 30 seconds before it was 3600 seconds.
And i am using TCP protocol.


Thanks In Anticipation!

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

Re: Turn Off VPN when VPN Server is not reachable in iOS 8

Post by Traffic » Tue Dec 30, 2014 12:53 pm

sumaiay wrote:i am using TCP protocol
Have you read the manual:
--connect-retry n
  • For --proto tcp-client, take n as the number of seconds to wait between connection retries (default=5).
--connect-timeout n
  • For --proto tcp-client, set connection timeout to n seconds (default=10).
--connect-retry-max n
  • For --proto tcp-client, take n as the number of retries of connection attempt (default=infinite).
https://community.openvpn.net/openvpn/w ... Page#index
Traffic wrote:Client Config
  • TCP:
    • connect-retry 5
      connect-retry-max 6 ## 6 retries times 5 seconds = 30 seconds
Perhaps you need a --connection-timeout parameter as well .. and adjust my example to your requirements.

sumaiay
OpenVpn Newbie
Posts: 4
Joined: Wed Dec 10, 2014 7:08 am

Re: Turn Off VPN when VPN Server is not reachable in iOS 8

Post by sumaiay » Fri Jan 02, 2015 4:50 am

Yes i have gone through the manual, therefore i did changes in my VPN Payload.
connect-timeout - 10
connect-retry-max - 0
connect-retry - 600

I assume iOS takes charge overriding the VPN Payload in the Config.

Post Reply