VPN on demand - how can I get it to disconnect?

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
robertmm
OpenVpn Newbie
Posts: 2
Joined: Sat Apr 21, 2018 5:46 pm

VPN on demand - how can I get it to disconnect?

Post by robertmm » Sat Apr 21, 2018 5:58 pm

Hi everyone,
I seem to have the opposite problem of everyone else.
My VPN on demand works fine on the connection side. I have a set of OnDemandRules configured, and
* the VPN disconnects when the iPhone switches to the trusted ssid
* the VPN connects when the iPhone switches to the untrusted ssid
* the VPN connects when the iPhone accesses an internal URL.
However, once it's connected "on demand" to the internal URL, it will maintain the connection and not disconnect until I switch to the trusted ssid.

I have tried disabling seamless tunnel, disabling reconnect on wake, and changing the network state detection to off.
Additionally, I removed the keepalive on the server.
What am I missing?

Here is the section from the mobileconfig:

Code: Select all

                                <key>AuthenticationMethod</key>
                                <string>Certificate</string>
                                <key>DisconnectOnIdle</key>
                                <integer>1</integer>
                                <key>DisconnectOnIdleTimer</key>
                                <integer>30</integer>
                                <key>OnDemandEnabled</key>
                                <integer>1</integer>
                                <key>OnDemandRules</key>
                                <array>
                                        <dict>
                                                <key>Action</key>
                                                <string>Disconnect</string>
                                                <key>InterfaceTypeMatch</key>
                                                <string>WiFi</string>
                                                <key>SSIDMatch</key>
                                                <array>
                                                        <string>trusted</string>
                                                </array>
                                        </dict>
                                        <dict>
                                                <key>Action</key>
                                                <string>Connect</string>
                                                <key>InterfaceTypeMatch</key>
                                                <string>WiFi</string>
                                                <key>SSIDMatch</key>
                                                <array>
                                                        <string>untrusted</string>
                                                </array>
                                        </dict>
                                        <dict>
                                                <key>Action</key>
                                                <string>EvaluateConnection</string>
                                                <key>ActionParameters</key>
                                                <array>
                                                        <dict>
                                                                <key>DomainAction</key>
                                                                <string>ConnectIfNeeded</string>
                                                                <key>Domains</key>
                                                                <array>
                                                                        <string>internal.example.com</string>
                                                                </array>
                                                        </dict>
                                                </array>
                                        </dict>
                                        <dict>
                                                <key>Action</key>
                                                <string>Disconnect</string>
                                        </dict>
                                </array>


MrBanjoo117
OpenVpn Newbie
Posts: 2
Joined: Mon Jul 24, 2023 8:08 pm

Re: VPN on demand - how can I get it to disconnect?

Post by MrBanjoo117 » Mon Jul 24, 2023 8:11 pm

Hi,
I know this is an old topic, but have you ever figured this out? I'm facing the same Problem right now, everything works fine except for the disconnect.

robertmm
OpenVpn Newbie
Posts: 2
Joined: Sat Apr 21, 2018 5:46 pm

Re: VPN on demand - how can I get it to disconnect?

Post by robertmm » Mon Jul 24, 2023 8:20 pm

No, unfortunately not

MrBanjoo117
OpenVpn Newbie
Posts: 2
Joined: Mon Jul 24, 2023 8:08 pm

Re: VPN on demand - how can I get it to disconnect?

Post by MrBanjoo117 » Mon Jul 24, 2023 8:45 pm

too bad, but thanks for the quick reply

Post Reply