IPv4 OverridePrimary 1 PayloadDescription Configures VPN settings PayloadDisplayName {{ algo_server_name }} PayloadIdentifier com.apple.vpn.managed.{{ algo_server_name + system | to_uuid | upper }} PayloadType com.apple.vpn.managed PayloadUUID {{ algo_server_name + system | to_uuid | upper }} PayloadVersion 1 Proxies HTTPEnable 0 HTTPSEnable 0 UserDefinedName AlgoVPN {{ algo_server_name }} VPN OnDemandEnabled {{ 1 if algo_ondemand_wifi or algo_ondemand_cellular else 0 }} OnDemandRules {% if algo_ondemand_wifi or algo_ondemand_cellular %} {% if algo_ondemand_wifi_exclude|b64decode != '_null' %} {% set WIFI_EXCLUDE_LIST = (algo_ondemand_wifi_exclude|b64decode|string).split(',') %} Action Disconnect InterfaceTypeMatch WiFi SSIDMatch {% for network_name in WIFI_EXCLUDE_LIST %} {{ network_name|e }} {% endfor %} {% endif %} Action {% if algo_ondemand_wifi %} Connect {% else %} Disconnect {% endif %} InterfaceTypeMatch WiFi URLStringProbe http://captive.apple.com/hotspot-detect.html Action {% if algo_ondemand_cellular %} Connect {% else %} Disconnect {% endif %} InterfaceTypeMatch Cellular URLStringProbe http://captive.apple.com/hotspot-detect.html {% endif %} Action {{ 'Disconnect' if algo_ondemand_wifi or algo_ondemand_cellular else 'Connect' }} AuthenticationMethod Password RemoteAddress {{ IP_subject_alt_name }}:{{ wireguard_port }} VPNSubType com.wireguard.{{ system }} VPNType VPN VendorConfig WgQuickConfig {{- lookup('template', 'client.conf.j2') | indent(8) }}