<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEVPNManager/onDemandRules",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEVPNManager(py)onDemandRules"
  },
  "title" : "onDemandRules"
}
-->

# onDemandRules

An ordered list of Connect On Demand rules.

```
var onDemandRules: [NEOnDemandRule]? { get set }
```

## Discussion

The VPN configuration can optionally be configured to connect automatically based on a variety of criteria specified in [`NEOnDemandRule`](/documentation/NetworkExtension/NEOnDemandRule) objects. The [`onDemandRules`](/documentation/NetworkExtension/NEVPNManager/onDemandRules) property contains the current set of Connect On Demand rules for the VPN configuration. Each rule is evaluated in order, and the first rule that matches all criteria on the current network is applied.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)