A ControlPlaneFilter is an ordered list of filter entries that match certain packets destined to the CPU and perform an action for those packets. In contrast to Filters, ControlPlaneFilters are often software-based filters that process packets before they are processed by the CPU. 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 ControlPlaneFilter resource is deployed system-wide to the nodes specified in the nodes or nodeSelectors properties. To filter data-plane packets as they ingress / egress a particular sub-interface, check out the Filter 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:ControlPlaneFiltermetadata:namespace:edaname:my-cp-filterspec:entries:-type:Autodescription:Accept BGP traffic from 10.0.0.1/32 to system IP addressesipEntry:sourcePrefix:10.0.0.1/32destinationPrefixSets:-bgp-neighbor-system-ipsdestinationPortName:BGPdestinationPortOperator:EqualsprotocolName:TCPaction:Accept-type:IPv4description:Drop all other trafficipEntry:action:Droplog:truenodeSelectors:-eda.nokia.com/security-profile = managed
cat<< 'EOF' | kubectl apply -f -apiVersion: filters.eda.nokia.com/v1kind: ControlPlaneFiltermetadata: namespace: eda name: my-cp-filterspec: entries: - type: Auto description: Accept BGP traffic from 10.0.0.1/32 to system IP addresses ipEntry: sourcePrefix: 10.0.0.1/32 destinationPrefixSets: - bgp-neighbor-system-ips destinationPortName: BGP destinationPortOperator: Equals protocolName: TCP action: Accept - type: IPv4 description: Drop all other traffic ipEntry: action: Drop log: true nodeSelectors: - eda.nokia.com/security-profile = managedEOF
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.