Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ThatOneAss

macrumors newbie
Original poster
Dec 13, 2020
12
2
Hi,

I used to have an Cisco IPSEC-VPN running and enabled on demand connections on my Mac and iDevices. This used to work w/o any flaws.
I recently switched to Unifi running a L2TP-VPN and here's where my problems start:
VPN on demand works fine on my iDevices, but not on my Mac.
When I connect to a WiFi other than my home, it connects, disconnects, connects, disconnects, etc.

The config I used on all devices is essentially the same. This used to work with the Cisco VPN.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>IPSec</key>
            <dict>
                <key>AuthenticationMethod</key>
                <string>SharedSecret</string>
                <key>LocalIdentifierType</key>
                <string>KeyID</string>
                <key>SharedSecret</key>
                <data>
                MySharedSecret
                </data>
            </dict>
            <key>IPv4</key>
            <dict>
                <key>OverridePrimary</key>
                <integer>1</integer>
            </dict>
            <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>MySSID</string>
                    </array>
                </dict>
                <dict>
                    <key>Action</key>
                    <string>Connect</string>
                    <key>InterfaceTypeMatch</key>
                    <string>WiFi</string>
                </dict>
                <dict>
                    <key>Action</key>
                    <string>EvaluateConnection</string>
                    <key>ActionParameters</key>
                    <array>
                        <dict>
                            <key>DomainAction</key>
                            <string>ConnectIfNeeded</string>
                            <key>Domains</key>
                            <array>
                                <string>*.localdomain</string>
                            </array>
                        </dict>
                    </array>
                </dict>
                <dict>
                    <key>Action</key>
                    <string>Disconnect</string>
                    <key>InterfaceTypeMatch</key>
                    <string>Cellular</string>
                </dict>
                <dict>
                    <key>Action</key>
                    <string>Disconnect</string>
                </dict>
            </array>
            <key>PPP</key>
            <dict>
                <key>AuthName</key>
                <string>MyUser</string>
                <key>AuthPassword</key>
                <string>MyPassword</string>
                <key>CommRemoteAddress</key>
                <string>MYDYNDNS</string>
            </dict>
            <key>PayloadDescription</key>
            <string>Configures VPN settings</string>
            <key>PayloadDisplayName</key>
            <string>VPN</string>
            <key>PayloadIdentifier</key>
            <string>com.apple.vpn.managed.AA8B2E3A-37E4-43ED-AD2A-B478EAF8EBFC</string>
            <key>PayloadType</key>
            <string>com.apple.vpn.managed</string>
            <key>PayloadUUID</key>
            <string>AA8B2E3A-37E4-43ED-AD2A-B478EAF8EBFC</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>Proxies</key>
            <dict>
                <key>HTTPEnable</key>
                <integer>0</integer>
                <key>HTTPSEnable</key>
                <integer>0</integer>
            </dict>
            <key>UserDefinedName</key>
            <string>on demand VPN</string>
            <key>VPNType</key>
            <string>L2TP</string>
        </dict>
    </array>
    <key>PayloadDisplayName</key>
    <string>on demand VPN</string>
    <key>PayloadIdentifier</key>
    <string>MacBook-Pro.D7C6BA7C-E96D-4BCE-90A5-DA68888461E8</string>
    <key>PayloadRemovalDisallowed</key>
    <false/>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>F9E3C06B-C3BE-4475-B6AE-0C480295F107</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>

I noticed the "on demand" button is missing from this option only on the Mac. It was available while I used to connect to the Cisco IPSEC.

When adding the connection manually, without the on demand rules, it works.

Is there anything I'm missing?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.