---
title: NENetworkRule
framework: networkextension
role: symbol
role_heading: Class
path: networkextension/nenetworkrule
---

# NENetworkRule

A rule to match attributes of network traffic.

## Declaration

```swift
class NENetworkRule
```

## Topics

### Creating a network rule

- [init(destinationNetwork:prefix:protocol:)](networkextension/nenetworkrule/init(destinationnetwork:prefix:protocol:).md)
- [init(destinationHost:protocol:)](networkextension/nenetworkrule/init(destinationhost:protocol:).md)
- [init(remoteNetwork:remotePrefix:localNetwork:localPrefix:protocol:direction:)](networkextension/nenetworkrule/init(remotenetwork:remoteprefix:localnetwork:localprefix:protocol:direction:).md)

### Matching network traffic characteristics

- [matchRemoteEndpoint](networkextension/nenetworkrule/matchremoteendpoint.md)
- [matchRemotePrefix](networkextension/nenetworkrule/matchremoteprefix.md)
- [matchLocalNetwork](networkextension/nenetworkrule/matchlocalnetwork.md)
- [matchLocalPrefix](networkextension/nenetworkrule/matchlocalprefix.md)
- [matchProtocol](networkextension/nenetworkrule/matchprotocol.md)
- [NENetworkRule.Protocol](networkextension/nenetworkrule/protocol.md)
- [matchDirection](networkextension/nenetworkrule/matchdirection.md)
- [NETrafficDirection](networkextension/netrafficdirection.md)

### Initializers

- [init(destinationHostEndpoint:protocol:)](networkextension/nenetworkrule/init(destinationhostendpoint:protocol:).md)
- [init(destinationNetworkEndpoint:prefix:protocol:)](networkextension/nenetworkrule/init(destinationnetworkendpoint:prefix:protocol:).md)
- [init(remoteNetworkEndpoint:remotePrefix:localNetworkEndpoint:localPrefix:protocol:direction:)](networkextension/nenetworkrule/init(remotenetworkendpoint:remoteprefix:localnetworkendpoint:localprefix:protocol:direction:).md)

### Instance Properties

- [matchLocalNetworkEndpoint](networkextension/nenetworkrule/matchlocalnetworkendpoint-62ttv.md)
- [matchRemoteHostOrNetworkEndpoint](networkextension/nenetworkrule/matchremotehostornetworkendpoint-4a5ht.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Transparent proxy configuration

- [NETransparentProxyManager](networkextension/netransparentproxymanager.md)
- [NETransparentProxyProvider](networkextension/netransparentproxyprovider.md)
- [NETransparentProxyNetworkSettings](networkextension/netransparentproxynetworksettings.md)
