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

# enforceRoutes

A Boolean value that indicates whether route rules for the tunnel take precedence over any locally defined routes.

```
var enforceRoutes: Bool { get set }
```

## Discussion

If this property is <doc://com.apple.documentation/documentation/Swift/true> when the [`includeAllNetworks`](/documentation/NetworkExtension/NEVPNProtocol/includeAllNetworks) property is <doc://com.apple.documentation/documentation/Swift/false>, the system scopes the included routes to the VPN and the excluded routes to the current primary network interface. This property supersedes the system routing table and scoping operations by apps.

If you set both the [`enforceRoutes`](/documentation/NetworkExtension/NEVPNProtocol/enforceRoutes) and [`excludeLocalNetworks`](/documentation/NetworkExtension/NEVPNProtocol/excludeLocalNetworks) properties to <doc://com.apple.documentation/documentation/Swift/true>, the system excludes network connections to hosts on the local network.

[`NETransparentProxyManager`](/documentation/NetworkExtension/NETransparentProxyManager) doesn’t support this property. The default value for this property is <doc://com.apple.documentation/documentation/Swift/false>.

> Note:
> You specify the included and excluded routes using the respective `includedRoutes` and `excludedRoutes` properties in the ``doc://com.apple.networkextension/documentation/NetworkExtension/NEIPv4Settings`` and ``doc://com.apple.networkextension/documentation/NetworkExtension/NEIPv6Settings`` objects that you provide in the ``doc://com.apple.networkextension/documentation/NetworkExtension/NEPacketTunnelProvider`` settings.

---

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)