Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a VPN Configuration Profile on iOS 7 [closed]

I had a configuration profile that I had set up on iOS 6, so that when a certain URL is hit, the VPN kicks in.

I was doing this using the following configuration profile keys:

<key>OnDemandEnabled</key>
<integer>1</integer>
<key>OnDemandMatchDomainsAlways</key>
<array>
    <string>my_homepage.com</string>
</array>

On iOS 6, this appears to work fine. However, in iOS 7, it looks like OnDemandMatchDomainAlways has been deprecated in favor of the OnDemandRules key, and the default behavior of "OnDemandMatchDomainAlways" is to behave like "OnDemandMatchDomainsOnRetry". So now, i am trying to get my previous setup to work on iOS 7, by using the OnDemandRules key, as follows:

<key>OnDemandRules</key>
<array>
    <dict>
        <key>Action</key>
        <string>Connect</string>
        <key>DNSDomainMatch</key>
        <array>
            <string>my_homepage.com</string>
        </array>
    </dict>
</array>

I also tried setting it up using this method:

<key>OnDemandRules</key>
    <array>
        <dict>
                    <key>Action</key>
            <string>EvaluateConnection</string>
            <key>ActionParameters</key>
            <array>
                <dict>
                    <key>Domains</key>
                    <array>
                        <string>url-that-redirects-if-vpn-off.com</string>
                    </array>
                    <key>DomainAction</key>
                    <string>ConnectIfNeeded</string>
            </dict>
        </array>
    </dict>
</array>

However, none of these methods seems to work. Does anyone know how to set up an iOS VPN profile so that the VPN OnDemand feature works on iOS 7 the same way it did on iOS6?

Thanks in advance,

like image 621
Hawkeye001 Avatar asked Sep 22 '13 20:09

Hawkeye001


People also ask

How manually configure VPN on IOS?

To configure a VPN on your iPhone or iPad, go to: Settings > General > VPN > Add VPN Configuration > Type. Here you can select IKEv2, IPSec (by itself), or L2TP (which includes IPSec encryption, even though it doesn't say so).

How do I setup a VPN on my iPhone without an app?

Setting up a VPN on iPhone without an app On your iPhone, go to 'Settings' Go to 'General' Scroll down to 'VPN' Press 'Add VPN configuration…'


1 Answers

I ran into the same problem and was able to get on-demand functionality again by placing the OnDemanRules key as part of the IPSec block, i.e.,

<key>IPSec</key>
<dict>
    <key>AuthenticationMethod</key>
    <string>Certificate</string>

    <!-- Other IPSEC VPN properties here. -->

    <key>OnDemandEnabled</key>
    <integer>1</integer>
    <key>OnDemandRules</key>
    <array>
        <dict>
        <key>Action</key>
        <string>Connect</string>
        <key>DNSDomainMatch</key>
        <array>
          <string>my_homepage.com</string>
        </array>
    </dict>
    </array>
</dict>

Note that this contradicts the published Configuration Profile Reference document. But, in my case, it made things work.

like image 52
ricardog Avatar answered Oct 17 '22 05:10

ricardog