VPN-On-Demand --- Only connect to VPN when trying to resolve certain Ip´s while using mobile data
Hello,
i have the following problem. I tried to install a VPN on my iPhone. This worked without any problems. Then I created a small Script to configure "VPN-On-Demand".
This also works without any problems. It automatically connects to my VPN when not being connected to my home Network.
So now I have the following problem. When being on cellular the VPN does not connect. For most of the time, this is sufficient that the iPhone does not connect to the VPN when it is on cellular data. (That's also supposed to be).
I have tried that the iPhone only connects to the VPN (while using mobile data) when calling certain IP addresses or domains.
Unfortunately, this does not work when I use mobile data.
Here is a part of my Code that I have used:
<!-- VPN-On-Demand Codeblock -->
<key>OnDemandEnabled</key>
<integer>1</integer>
<key>OnDemandRules</key>
<array>
<!-- VPN beim Zugriff auf Heimnetz-Adressen aufbauen -->
<dict>
<key>Action</key>
<string>EvaluateConnection</string>
<key>ActionParameters</key>
<array>
<dict>
<key>Domains</key>
<array>
<string>*.local</string>
<string>192.168.1.45</string>
<string>192.168.4.77:8581</string>
<string>*.168.4.77</string>
<string>*.168.1</string>
</array>
<key>DomainAction</key>
<string>ConnectIfNeeded</string>
</dict>
</array>
</dict>
<dict>
<!-- VPN bei ausgewählten WLAN-Netzen deaktivieren -->
<key>InterfaceTypeMatch</key>
<string>WiFi</string>
<key>SSIDMatch</key>
<array>
<string>Chewbacca</string>
</array>
<key>Action</key>
<string>Disconnect</string>
</dict>
<dict>
<!-- VPN bei aktiver WLAN-Verbindung aktivieren -->
<key>InterfaceTypeMatch</key>
<string>WiFi</string>
<key>Action</key>
<string>Connect</string>
</dict>
<dict>
<!-- VPN im Mobilfunknetz nicht aktivieren -->
<key>InterfaceTypeMatch</key>
<string>Cellular</string>
<key>Action</key>
<string>Disconnect</string>
</dict>
<dict>
<!-- VPN Default state -->
<key>Action</key>
<string>Disconnect</string>
</dict>
</array>
<!-- VPN-On-Demand Codeblock ENDE-->
It would be a pleasure if somebody can help me figuring out what the problem is.
Thank you !
Greetings,
Smartapple002