Our app uses NEVPNManager with IPsec to create VPN. It uses certificate authentication(.p12) and VPN connectivity is working as expected.
Now I am trying to apply On demand rules to manage this VPN.
let onDemandRule = NEOnDemandRuleConnect()
onDemandRule.interfaceTypeMatch = .wiFi
onDemandRule.ssidMatch = ["DNET"]
NEOnDemandRuleConnect with interfaceTypeMatch and ssidMatch is starting VPN when the rule matches.
When I add onDemandRule.dnsSearchDomainMatch = ["pa.test2.com"], it is not switching ON the VPN when I browse the "pa.test2.com" in the safari. I also tried *.test2.com and *.com. None of these domains switching ON the VPN.
Can you please help me if I am missing anything?
Just to be clear, you’re using the Personal VPN API, right? That is, you’re not building an NE provider for a custom VPN transport, but instead configuring one of the built-in VPN transports.
If so, my general advice on this front is to start by creating a VPN configuration profile. Once you get that working, I can explain how to set that up with the NEVPNManager
API.
A good place to start with VPN configuration profiles is Apple Configurator. And if you get stuck, I recommend that you seek help in Apple Support Community, run by Apple Support, and specifically in the Business and Education topic area. You’re more likely to find folks with VPN configuration experience over there.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"