<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEFilterRule",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEFilterRule"
  },
  "title" : "NEFilterRule"
}
-->

# NEFilterRule

A rule for filters that combines a rule to match network traffic and an action to take when the rule matches.

```
class NEFilterRule
```

## Topics

### Creating a Filter Rule

[`-  initWithNetworkRule:action:`](/documentation/NetworkExtension/NEFilterRule/init(networkRule:action:))

Creates a new filter rule from a network rule and an action to take when network traffic matches.

### Inspecting Filter Rule Properties

[`networkRule`](/documentation/NetworkExtension/NEFilterRule/networkRule)

The network rule that defines the network traffic characteristics that this filter rule matches.

[`action`](/documentation/NetworkExtension/NEFilterRule/action)

The action to take when this rule matches network traffic.

## Relationships

### Conforms To

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)