---
title: enforceRoutes
framework: networkextension
role: symbol
role_heading: Instance Property
path: networkextension/nevpnprotocol/enforceroutes
---

# enforceRoutes

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

## Declaration

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

## Mentioned in

Routing your VPN network traffic

## Discussion

Discussion If this property is true when the includeAllNetworks property is 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 and excludeLocalNetworks properties to true, the system excludes network connections to hosts on the local network. NETransparentProxyManager doesn’t support this property. The default value for this property is false. note: You specify the included and excluded routes using the respective includedRoutes and excludedRoutes properties in the NEIPv4Settings and NEIPv6Settings objects that you provide in the NEPacketTunnelProvider settings.

## See Also

### Routing network traffic

- [includeAllNetworks](networkextension/nevpnprotocol/includeallnetworks.md)
- [excludeAPNs](networkextension/nevpnprotocol/excludeapns.md)
- [excludeCellularServices](networkextension/nevpnprotocol/excludecellularservices.md)
- [excludeLocalNetworks](networkextension/nevpnprotocol/excludelocalnetworks.md)
