3.3 Troubleshoot control-plane policing for management and routing protocols
ENARSI 300-410 v1.1 · 3.0 Infrastructure Security
Control-plane policing (CoPP) protects the router's CPU. Packets addressed to the router itself (routing protocols, SSH, SNMP, ICMP) are classified with ACLs and class maps, and a policy map on the control-plane polices each class to a safe rate. A wrong class or rate breaks the very protocols it should protect.
What you must know
- Classify control-plane traffic with ACLs and class maps.
- Build a policy map with
policeactions and apply it tocontrol-plane. - Know that the ACL
permitmeans "in this class", not "allow". - Read
show policy-map control-planeto find drops.
Building a CoPP policy
ip access-list extended COPP-ROUTING
permit ospf any any
permit tcp any any eq bgp
permit tcp any eq bgp any
ip access-list extended COPP-MGMT
permit tcp 10.0.99.0 0.0.0.255 any eq 22
permit udp 10.0.99.0 0.0.0.255 any eq snmp
ip access-list extended COPP-ICMP
permit icmp any any
!
class-map match-all CRITICAL
match access-group name COPP-ROUTING
class-map match-all MGMT
match access-group name COPP-MGMT
class-map match-all ICMP
match access-group name COPP-ICMP
!
policy-map COPP
class CRITICAL
police 512000 conform-action transmit exceed-action transmit
class MGMT
police 256000 conform-action transmit exceed-action drop
class ICMP
police 64000 conform-action transmit exceed-action drop
class class-default
police 128000 conform-action transmit exceed-action drop
!
control-plane
service-policy input COPPOSPF keeps working under load (1); the ping flood is cut to 64 kbit/s (2).
Troubleshooting CoPP
R1# show policy-map control-plane
Control Plane
Service-policy input: COPP
Class-map: ICMP (match-all)
18234 packets, 1823400 bytes
5 minute offered rate 312000 bps, drop rate 248000 bps
Match: access-group name COPP-ICMP
police:
cir 64000 bps, bc 2000 bytes
conformed 2310 packets, 231000 bytes; actions:
transmit
exceeded 15924 packets, 1592400 bytes; actions:
drop- A neighbour flaps after CoPP: its protocol is in a class that drops (often class-default). Add it to the routing ACL.
- SSH is refused from a new jump host: its subnet is not in the management ACL, so it fell into class-default.
- A
denyline in a CoPP ACL means "not in this class": the packet is checked against the next class, not dropped. - Classes are checked in order, so put the most specific first.
Commands
show policy-map control-plane | Per-class counters, rates, conform and exceed actions. |
show class-map | Each class and what it matches. |
show access-lists | Hit counters on the classification ACLs. |
Exam traps
- An ACL
denyin a class map does not drop; it just doesn't match that class. - Policing routing protocols with
exceed-action dropand a low rate causes neighbour flaps. - CoPP only sees traffic to the router, never transit traffic.
- class-default catches everything else, including protocols you forgot.
Check yourself
- Why does BGP need two ACL lines in the routing class?
- The router can be the client (destination port 179) or the server (source port 179) of the session.
- What does
denymean in an ACL used by a CoPP class map? - The packet is not in that class and goes on to the next class.
- OSPF flaps after CoPP was applied. Where do you look?
show policy-map control-plane: which class matches OSPF and whether it exceeds and drops.- Does CoPP affect traffic passing through the router?
- No, only traffic to the control plane.
Labs
Try it live: CoPP troubleshooting: the policy that never polices