/ howto

vpn on demand rules, update

during the last weeks, i figured out, that setting my vpn rules to “always connect to vpn” can cause several issues, mainly resulting in poor battery runtime. therefor i updated my ruleset:

  • always connect (cellular network)
  • connect to known networks (listed in first )

the downside

if i connect to a new network, i have to manually switch on vpn in settings.app (iphone) and/or i have to edit my .mobileconfig-file.


current on demand rules

	<key>OnDemandEnabled</key>
	<integer>1</integer>
            
	<key>OnDemandRules</key>
	<array>
		<dict>
			<key>Action</key>
			<string>Connect</string>
			<key>InterfaceTypeMatch</key>
			<string>WiFi</string>
			<key>SSIDMatch</key>
			<array>
				<string>Name of my Home Network</string>
				<string>Company WiFi</string>
			</array>
		</dict>
		
		<dict>
			<key>Action</key>
			<string>Connect</string>                  
			<key>InterfaceTypeMatch</key>
			<string>Cellular</string>
		</dict>
		
		<dict>
			<key>Action</key>
			<string>Disconnect</string>
		</dict>
	</array>
main picture by bossfight, CC0 1.0 license