A Filter is an ordered list of filter entries that match certain packets and perform an action for those packets. Packets can be matched by their source IP, destination IP, source port, destination port, and many others. There are 2 types of filters:
IP filters that can match based on the IP header of an IP packet
MAC filters that can match based on the layer 2 (ethernet) header of an ethernet frame
Note
A Filter resource is deployed through resources like RoutedInterface or IRBInterface that determine which sub-interface the Filter applies to. For system-wide control plane filters, check out the ControlPlaneFilter resource.
The packet is filtered through all filter entries in-order. If there is no match, the packet is evaluated against the next entry and so on. Once a packet matches a particular entry, evaluation of the chain ends and the action specified in the entry is performed on the packet.
In the ipEntry context, source and destination prefixes can be entered manually through the sourcePrefix and destinationPrefix properties. If the entry must execute the same action for source / destination IP addresses in multiple discontiguous subnets, consider using a PrefixSet to group those subnets together.
apiVersion:filters.eda.nokia.com/v1kind:Filtermetadata:namespace:edaname:my-dataplane-filterspec:entries:-type:AutoipEntry:protocolName:ICMPaction:RateLimiticmpTypeName:EchorateLimit:peakRateKbps:10000entrySpecificPolicer:falsescope:Globaldescription:Rate-limit ICMP Echo requests-type:Autodescription:Accept all other trafficipEntry:sourcePrefix:0.0.0.0/0action:Accept
cat<< 'EOF' | kubectl apply -f -apiVersion: filters.eda.nokia.com/v1kind: Filtermetadata: namespace: eda name: my-dataplane-filterspec: entries: - type: Auto ipEntry: protocolName: ICMP action: RateLimit icmpTypeName: Echo rateLimit: peakRateKbps: 10000 entrySpecificPolicer: false scope: Global description: Rate-limit ICMP Echo requests - type: Auto description: Accept all other traffic ipEntry: sourcePrefix: 0.0.0.0/0 action: AcceptEOF
To browse the Custom Resource Definition go to crd.eda.dev.
Filter
filters.eda.nokia.com / v1
SPEC
Filter allows for the creation and management of ordered filtering rules based on IP or MAC criteria. The resource supports various conditions and actions, enabling fine-grained control over network traffic by specifying rules for source and destination addresses, ports, and protocols.
Determines how the policer is applied across subinterfaces. Global applies the policer across all subinterfaces, while Subinterface applies it individually to each subinterface.
Ethernet frame matching criteria based on the outermost VLAN ID found before the subinterface-defining VLAN tag (if any) is removed. A value of 'none' will match only untagged frames.
Determines how the policer is applied across subinterfaces. Global applies the policer across all subinterfaces, while Subinterface applies it individually to each subinterface.