Control Plane Policing (CoPP) protects the supervisor of NX-OS devices by classifying and rate-limiting traffic that is punted to the CPU. A predefined CoPP profile (copp profile strict | moderate | lenient | dense) can be selected, or a custom control-plane policy can be built from control-plane class maps (class-map type control-plane) and policy maps (policy-map type control-plane) and applied with control-plane > service-policy input <name>. Control-plane class maps match access lists, exception packets (for example glean, TTL or MTU failures, IP options, ICMP redirects and multicast RPF failures), redirected packets and protocols. Each class of a control-plane policy map polices matching traffic with a CIR (and optionally PIR) rate and burst, and can mark CoS or DSCP and log dropped packets. The short form police pps <rate> is configured as cir_rate: <rate> with cir_unit: pps. Applying a custom service policy replaces the CoPP profile; to remove it, select a CoPP profile again. Support for individual match and set options depends on the platform.
Example 2: Custom control-plane policy that polices management and ARP traffic (class-map type control-plane, policy-map type control-plane, control-plane > service-policy input)
nxos:
devices:
- name: LEAF1
configuration:
ip_access_lists:
- name: ACL-COPP-MGMT
entries:
- sequence_number: 10
action: permit
protocol: tcp
source:
prefix: 10.0.0.0
prefix_length: 8
destination:
prefix: any
port_operator: eq
port_1: 22
qos:
control_plane_class_maps:
- name: CM-COPP-MGMT
match_type: match-any
match_access_group_names:
- ACL-COPP-MGMT
- name: CM-COPP-ARP
match_type: match-any
match_protocol_arp: true
control_plane_policy_maps:
- name: PM-COPP
classes:
- name: CM-COPP-MGMT
police:
cir_rate: 5000
cir_unit: pps
bc_rate: 128
bc_unit: packets
conform_action: transmit
violate_action: drop
- name: CM-COPP-ARP
police:
cir_rate: 1000
cir_unit: pps
bc_rate: 64
bc_unit: packets
conform_action: transmit
violate_action: drop
set_cos: 6
logging_drop_threshold: 1000
logging_drop_level: 5
system:
control_plane_service_policy_input: PM-COPP
Example 3: Control-plane class map matching exception packets (match exception glean, match exception ip option, match exception ip icmp redirect, match exception ipv6 icmp unreachable, match exception multicast rpf-failure)