- Preface
- Product Overview
- Command-line Interfaces
- Configuring the Switch for the First Time
- Administering the Switch
- Configuring the Cisco IOS In Service Software Upgrade Process
- Configuring Interfaces
- Checking Port Status and Connectivity
- Configuring Supervisor Engine Redundancy Using RPR and SSO
- Configuring Cisco NSF with SSO Supervisor Engine Redundancy
- Environmental Monitoring and Power Management
- Configuring Power over Ethernet
- Configuring Energy Wise
- Configuring the Catalyst 4500 Series Switch with Cisco Network Assistant
- Configuring VLANs, VTP, and VMPS
- Configuring IP Unnumbered Interface
- Configuring Layer 2 Ethernet Interfaces
- Configuring SmartPort Macros
- Configuring STP and MST
- Configuring Flex Links and the MAC Address-Table Move Update Feature
- Configuring Resilient Ethernet Protocol
- Configuring Optional STP Features
- Configuring EtherChannels
- Configuring IGMP Snooping and Filtering
- Configuring IPv6 MLD Snooping
- Configuring 802.1Q and Layer 2 Protocol Tunneling
- Configuring CDP
- Configuring LLDP and LLDP-MED
- Configuring UDLD
- Configuring Unidirectional Ethernet
- Configuring Layer 3 Interfaces
- Configuring Cisco Express Forwarding
- Configuring Unicast Reverse Path Forwarding
- Configuring IP Multicast
- Configuring ANCP Client
- Configuring Policy-Based Routing
- Configuring VRF-lite
- Configuring Quality of Service
- Configuring Voice Interfaces
- Configuring Private VLANs
- Configuring 802.1X Port-Based Authentication
- Configuring PPPoE Intermediate Agent
- Configuring Web-Based Authentication
- Configuring Port Security
- Configuring Control Plane Policing
- Configuring DHCP Snooping, IP Source Guard, and IPSG for Static Hosts
- Configuring Dynamic ARP Inspection
- Configuring Network Security with ACLs
- Port Unicast and Multicast Flood Blocking
- Configuring Storm Control
- Configuring SPAN and RSPAN
- Configuring System Message Logging
- Configuring SNMP
- Configuring NetFlow
- Configuring Ethernet CFM and OAM
- Configuring Y.1731 (AIS and RDI)
- Configuring Call Home
- Configuring Cisco IOS IP SLAs Operations
- Configuring RMON
- Performing Diagnostics
- Configuring WCCP Version 2 Services
- ROM Monitor
- Configuring MIB Support
- Index
- Acronyms
Configuring Control Plane Policing
This chapter contains information on how to protect your Catalyst 4000 family switch using control plane policing (CoPP). The information covered in this chapter is unique to the Catalyst 4500 series switches, and it supplements the network security information and procedures in Chapter 47 "Configuring Network Security with ACLs." This information also supplements the network security information and procedures in these publications:
•Cisco IOS Security Configuration Guide, Cisco IOS Release 12.4, at this URL:
http://www.cisco.com/en/US/docs/ios/security/configuration/guide/12_4/sec_12_4_book.html
•Cisco IOS Security Command Reference, Cisco IOS Release 12.4, at this URL:
http://www.cisco.com/en/US/docs/ios/security/command/reference/sec_book.html
This chapter includes the following major sections:
•Understanding How Control Plane Policing Works
•Caveats for Control Plane Policing
•CoPP Configuration Guidelines and Restrictions
Note For complete syntax and usage information for the switch commands used in this chapter, look at the Cisco Catalyst 4500 Series Switch Command Reference and related publications at this location:
http://www.cisco.com/en/US/products//hw/switches/ps4324/index.html
If the command is not found inthe Catalyst 4500 Command Reference, it will be found in the larger Cisco IOS library. Refer to the Cisco IOS Command Reference and related publications at this location:
http://www.cisco.com/en/US/products/ps6350/index.html
Understanding How Control Plane Policing Works
The control plane policing (CoPP) feature increases security on the Catalyst 4000 family switch by protecting the CPU from unnecessary or DoS traffic and giving priority to important control plane and management traffic. The classification TCAM and QoS policers provide CoPP hardware support.
Note CoPP is supported on the following: Classic Series supervisor engines and switches beginning with Cisco IOS Release 12.2(31)SG; Supervisor 6-E and Catalyst 4900M beginning with Cisco IOS Release 12.2(50)SG; and Supervisor 6L-E in Cisco IOS Release 12.2(52)X0.
The traffic managed by the CPU is divided into three functional components or planes:
•Data plane
•Management plane
•Control plane
You can use CoPP to protect most of the CPU bound traffic and ensure routing stability, reachability and packet delivery. Most importantly, CoPP is often used to protect the CPU from the DoS attack. There is a list of pre-defined ACLs matching a selected set of Layer 2 and Layer 3 control plane packets. You can define your preferred policing parameters to each of these control packets but you cannot modify the matching criteria of these pre-defined ACLs. Following is the list of pre-defined ACLs:
For the Data Plane and Management Plane traffic, you can define your own ACLs to match the traffic class that you want to police.
CoPP uses MQC to define traffic classification criteria and to specify the configurable policy actions for the classified traffic. MQC uses class maps to define packets for a particular traffic class. After you have classified the traffic, you can create policy maps to enforce policy actions for the identified traffic. The control-plane global configuration command allows the CoPP service policy to be directly attached to the control plane.
The only policy-map that you can attach to the control-plane is system-cpp-policy. It must contain the pre-defined class-maps in the pre-defined order at the beginning of the policy map. The best way to create the system-cpp-policy policy-map is through the global macro system-cpp.
The system-cpp-policy contains the pre-defined class maps for the control plane traffic. The names of all system defined CoPP class maps and their matching ACLs contain the prefix "system-cpp-". By default, no action is specified for each traffic class. You can define your own class maps matching CPU bound data plane and management plane traffic. You can add your defined class maps to the system-cpp-policy policy-map.
Caveats for Control Plane Policing
•Port Security might cancel its effect for non-IP control packets.
Although Source MAC Learning on the Catalyst 4500 series switch is performed in software, learning of source MAC addresses from control packets (e.g.: IEEE BPDU/CDP/SSTP BPDU/GARP/etc) is dis-allowed. Once you configure Port Security on a port where you expect to receive a high rate of such (possibly rogue) control packets, the system generates a copy of the packet to the CPU (until the source address is learned, how Port Security is implemented), rather than forward it.
The current architecture of the Catalyst 4500 switching engine does not allow you to apply policing on the copy of packets sent to the CPU; policing can only be applied on packets that are forwarded to CPU. So, copies of packets are sent to the CPU at the rate control packets arrive and Port Security is not triggered because learning from control packets is dis-allowed. Furthermore, policing will not be applied because the packet copy, not the original, is sent to the CPU.
•As of Cisco IOS Release 12.2(31)SGA1, the GARP class is no longer part of the CoPP. (Due to the fix associated with CSCsg08775, even though the system-cpp-garp-range entry still appears in the CPP configuration, it is merely idling and will be removed in future releases.) Henceforward, you can manipulate GARP traffic with user ACLs and QoS. If you want to protect CPU against GARP packets, you also can "police down" GARP packets using CoPP after you define the user class for the GARP packet. (This is now possible because GARP is no longer part of the Static CAM area.)
Due to tight integration of CPP implementation between IOS and platform code, an error message will always appear during boot-up and CPP will not be applied when downgrading IOS software from a version where this caveat is integrated to a previous release (where this fix is not present):
%Invalid control plane policy-map; Please unconfigure policy-map attached to control-plane, and associated class-maps, and execute config command "macro global apply system-cpp" error: failed to install policy map system-cpp-policy
As a workaround do the following:
1. Back-up your configuration when performing software downgrading.
2. Remove all CPP entries manually from the config and then re-appy the
macro global apply system-cpp command.
There should be no problem associated with this caveat while upgrading between releases.
•ARP policing is not supported on either Classic series supervisor engines or fixed configuration switches. It is, however, supported on the Supervisor Engine 6-E and the Catalyst 4900M switch.
•You cannot remove a macro populated class from the list of classes within a control plane policy.
•Prior to Cisco IOS Release 12.2(50)SG, on switches with Supervisor Engines V, V-10GE and earlier, class-map hit statistics on a user defined class-map in system-cpp-policy are not updated properly. With Cisco IOS Release 12.2(50)SG, the hit statistics for user-defined class-map in the system-cpp-policy are updated properly. However, in per-vlan capture mode, the hit stats for system defined in system-cpp-policy are not updated. In the global capture mode, hit stats for all class-maps (user-defined and system-defined) in the system-cpp-policy are updated properly.
CoPP Default Configuration
CoPP is disabled by default.
Configuring CoPP
This section includes the following tasks:
•Configure CoPP for Control Plane Traffic
•Configure CoPP for Data Plane and Management Plane Traffic
Configure CoPP for Control Plane Traffic
To configure CoPP for Control Plane traffic, perform this task:
The following example shows how to police CDP packets:
Switch# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# qos
Switch(config)# macro global apply system-cpp
Switch(config)# policy-map system-cpp-policy
Switch(config-pmap)# class system-cpp-cdp
Switch(config-pmap-c)# police 32000 1000 conform-action transmit exceed-action drop Switch(config-pmap-c)# end
Switch# show policy-map system-cpp-policy
Policy Map system-cpp-policy
Class system-cpp-dot1x
Class system-cpp-bpdu-range
* Class system-cpp-cdp
police 32000 bps 1000 byte conform-action transmit exceed-action drop *
Class system-cpp-sstp
Class system-cpp-cgmp
Class system-cpp-hsrpv2
Class system-cpp-ospf
Class system-cpp-igmp
Class system-cpp-pim
Class system-cpp-all-systems-on-subnet
Class system-cpp-all-routers-on-subnet
Class system-cpp-ripv2
Class system-cpp-ip-mcast-linklocal
Class system-cpp-dhcp-cs
Class system-cpp-dhcp-sc
Class system-cpp-dhcp-ss
Switch#
Configure CoPP for Data Plane and Management Plane Traffic
To configure CoPP for Data Plane and Management Plane traffic, perform this task:
The following example shows how to configure trusted hosts with source addresses 10.1.1.1 and 10.1.1.2 to forward Telnet packets to the control plane without constraint, while allowing all remaining Telnet packets to be policed at the specific rate (this example assumes the global qos is enabled and the system-cpp-policy policy-map has been created):
Switch# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# qos
Switch(config)# macro global apply system-cpp
! Allow 10.1.1.1 trusted host traffic.
Switch(config)# access-list 140 deny tcp host 10.1.1.1 any eq telnet
! Allow 10.1.1.2 trusted host traffic.
Switch(config)# access-list 140 deny tcp host 10.1.1.2 any eq telnet
! Rate limit all other Telnet traffic.
Switch(config)# access-list 140 permit tcp any any eq telnet
! Define class-map "telnet-class."
Switch(config)# class-map telnet-class
Switch(config-cmap)# match access-group 140
Switch(config-cmap)# exit
! Add the class-map "telnet-class" to "system-cpp-policy" and define ! the proper action
Switch(config)# policy-map system-cpp-policy
Switch(config-pmap)# class telnet-class
Switch(config-pmap-c)# police 80000 1000 conform transmit exceed drop Switch(config-pmap-c)# exit
Switch(config-pmap)# exit
! Verify the above configuration steps
Switch# show policy-map system-cpp-policy
Policy Map system-cpp-policy
Class system-cpp-dot1x
Class system-cpp-bpdu-range
Class system-cpp-cdp
police 32000 bps 1000 byte conform-action transmit exceed-action drop
Class system-cpp-sstp
Class system-cpp-cgmp
Class system-cpp-hsrpv2
Class system-cpp-ospf
Class system-cpp-igmp
Class system-cpp-pim
Class system-cpp-all-systems-on-subnet
Class system-cpp-all-routers-on-subnet
Class system-cpp-ripv2
Class system-cpp-ip-mcast-linklocal
Class system-cpp-dhcp-cs
Class system-cpp-dhcp-sc
Class system-cpp-dhcp-ss
* Class telnet-class
police 8000 bps 1000 byte conform-action drop exceed-action drop
CoPP Configuration Guidelines and Restrictions
When configuring CoPP, follow these guidelines and restrictions:
•Only ingress CoPP is supported. So only input keyword is supported in control-plane related CLIs.
•Use the system defined class maps for policing control plane traffic.
•Control plane traffic can be policed only using CoPP. Traffic cannot be policed at the input interface or VLAN even though a policy-map containing the control-plane traffic is accepted when the policy-map is attached to an interface or VLAN.
•System-defined class maps cannot be used in policy-maps for regular QoS.
•Use ACLs and class-maps to identify data plane and management plane traffic that are handled by CPU. User-defined class maps should be added to the system-cpp-policy policy-map for CoPP.
•The policy-map named system-cpp-policy is dedicated for CoPP.
•The default system-cpp-policy map does not define actions for the system-defined class maps, which means no policing.
•The only action supported in system-cpp-policy policy-map is police.
•Do not use the log keyword in the CoPP policy ACLs.
•Both MAC and IP ACLs can be used to define data plane and management plane traffic classes. But if a packet also matches a pre-defined ACL for the control plane traffic, the police action (or no police action) of the control plane class will be taken as the control plane classes appear above user-defined classes in the service policy. This is the same MQC semantic.
•The exceeding action policed-dscp-transmit is not supported for CoPP.
•CoPP is not enabled unless the global QoS is enabled and police action is specified.
Monitoring CoPP
You can enter the show policy-map control-plane command for developing site-specific policies, monitoring statistics for the control plane policy, and troubleshooting CoPP. This command displays dynamic information about the actual policy applied including rate information and the number of bytes (and packets) that conformed or exceeded the configured policies both in hardware and in software.
The output of the show policy-map control-plane command is as follows:
Switch# show policy-map control-plane
Control Plane
Service-policy input: system-cpp-policy
Class-map: system-cpp-dot1x (match-all)
0 packets
Match: access-group name system-cpp-dot1x
Class-map: system-cpp-bpdu-range (match-all)
0 packets
Match: access-group name system-cpp-bpdu-range
* Class-map: system-cpp-cdp (match-all)
160 packets
Match: access-group name system-cpp-cdp
** police: Per-interface
Conform: 22960 bytes Exceed: 0 bytes
*
Class-map: system-cpp-sstp (match-all)
0 packets
Match: access-group name system-cpp-sstp
Class-map: system-cpp-cgmp (match-all)
0 packets
Match: access-group name system-cpp-cgmpp
Class-map: system-cpp-hsrpv2 (match-all)
0 packets
Match: access-group name system-cpp-hsrpv2
Class-map: system-cpp-ospf (match-all)
0 packets
Match: access-group name system-cpp-ospf
Class-map: system-cpp-igmp (match-all)
0 packets
Match: access-group name system-cpp-igmp
Class-map: system-cpp-pim (match-all)
0 packets
Match: access-group name system-cpp-pim
Class-map: system-cpp-all-systems-on-subnet (match-all)
0 packets
Match: access-group name system-cpp-all-systems-on-subnet
Class-map: system-cpp-all-routers-on-subnet (match-all)
0 packets
Match: access-group name system-cpp-all-routers-on-subnet
Class-map: system-cpp-ripv2 (match-all)
0 packets
Match: access-group name system-cpp-ripv2
Class-map: system-cpp-ip-mcast-linklocal (match-all)
0 packets
Match: access-group name system-cpp-ip-mcast-linklocal
Class-map: system-cpp-dhcp-cs (match-all)
83 packets
Match: access-group name system-cpp-dhcp-cs
Class-map: system-cpp-dhcp-sc (match-all)
0 packets
Match: access-group name system-cpp-dhcp-sc
Class-map: system-cpp-dhcp-ss (match-all)
0 packets
Match: access-group name system-cpp-dhcp-ss
* Class-map: telnet-class (match-all)
0 packets
Match: access-group 140
** police: Per-interface
Conform: 0 bytes Exceed: 0 bytes*
Class-map: class-default (match-any)
0 packets
Match: any
0 packets
Switch#
To clear the counters on the control-plane, enter the clear control-plane * command:
Switch# clear control-plane *
Switch#
To display all the CoPP access list information, enter the show access-lists command:
Switch# show access-lists
Extended IP access list system-cpp-all-routers-on-subnet
10 permit ip any host 224.0.0.2
Extended IP access list system-cpp-all-systems-on-subnet
10 permit ip any host 224.0.0.1
Extended IP access list system-cpp-dhcp-cs
10 permit udp any eq bootpc any eq bootps Extended IP access list
system-cpp-dhcp-sc
10 permit udp any eq bootps any eq bootpc Extended IP access list
system-cpp-dhcp-ss
10 permit udp any eq bootps any eq bootps Extended IP access list
system-cpp-igmp
10 permit igmp any 224.0.0.0 31.255.255.255 Extended IP access list
system-cpp-ip-mcast-linklocal
10 permit ip any 224.0.0.0 0.0.0.255 Extended IP access list
system-cpp-ospf
10 permit ospf any 224.0.0.0 0.0.0.255 Extended IP access list
system-cpp-pim
10 permit pim any 224.0.0.0 0.0.0.255 Extended IP access list
system-cpp-ripv2
10 permit ip any host 224.0.0.9
Extended MAC access list system-cpp-bpdu-range
permit any 0180.c200.0000 0000.0000.000f Extended MAC access list
system-cpp-cdp
permit any host 0100.0ccc.cccc
Extended MAC access list system-cpp-cgmp
permit any host 0100.0cdd.dddd
Extended MAC access list system-cpp-dot1x
permit any host 0180.c200.0003
system-cpp-sstp
permit any host 0100.0ccc.cccd
To display one CoPP access list, enter the show access-lists system-cpp-cdp command:
Switch# show access-list system-cpp-cdp
Extended MAC access list system-cpp-cdp
permit any host 0100.0ccc.cccc
Switch#