|
|
This document describes enhancements to the Unicast Reverse Path Forwarding feature. Unicast Reverse Path Forwarding (RPF) helps to mitigate network attacks caused by data packets with malformed or forged IP source addresses received at the router.
This document includes the following sections:
The Unicast Reverse Path Forwarding feature has been enhanced to use access control lists (ACLs) in determining whether to drop or forward data packets that have malformed or forged IP source addresses. An option in the ACL commands allows system administrators to log information about dropped or forwarded packets. Logging information about forged packets can help in uncovering information about possible network attacks.
Per-interface statistics can help system administrators quickly discover the interface serving as the entry point for an attack on the network.
Each of these enhancements is described fully in this document. For more information about the Unicast Reverse Path Forwarding feature, refer to the section "Related Documents" in this document.
When Unicast Reverse Path Forwarding is enabled on an interface, the router examines all packets received on that interface. The router checks to make sure that the source address appears in the routing table and matches the interface on which the packet was received. This "look backwards" ability is available only when Cisco Express Forwarding (CEF) is enabled on the router because the lookup relies on the presence of the Forwarding Information Base (FIB). CEF generates the FIB as part of its operation.
The Unicast Reverse Path Forwarding feature checks to see if any packet received at a router interface arrives on one of the best return paths to the source of the packet. The feature does this by doing a reverse lookup in the CEF table. If Unicast RPF does not find a reverse path for the packet, Unicast RPF can drop or forward the packet, depending on whether an ACL is specified in the Unicast Reverse Path Forwarding command. If an ACL is specified in the command, then when (and only when) a packet fails the Unicast RPF check, the ACL is checked to see if the packet should be dropped (using a deny statement in the ACL) or forwarded (using a permit statement in the ACL). Whether a packet is dropped or forwarded, the packet is counted in the global IP traffic statistics for Unicast RPF drops and in the interface statistics for Unicast RPF.
If no ACL is specified in the Unicast Reverse Path Forwarding command, the router drops the forged or malformed packet immediately and no ACL logging occurs. The router and interface Unicast RPF counters are updated.
Unicast RPF events can be logged by specifying the logging option for the ACL entries used by the Unicast Reverse Path Forwarding command. Log information can be used to gather information about the attack, such as source address, time, and so on.
![]() |
Caution Logging requires CPU and memory resources. Logging Unicast RPF events for attacks having a high rate of forged packets can degrade the performance of the router. |
Each time a packet is dropped or forwarded at an interface, that information is counted two ways: globally on the router and at each interface where you have applied Unicast RPF. Global statistics on dropped packets provide information about potential attacks on the network; however, these global statistics do not help to specify which interface is the source of the attack.
Per-interface statistics track two types information about malformed packets: Unicast RPF drops and Unicast RPF suppressed drops. Statistics on the number of packets that Unicast RPF drops help to identify the interface that is the entry point of the attack. The Unicast RPF drop count tracks the number of drops at the interface. The Unicast RPF suppressed drop count tracks the number of packets that failed the Unicast RPF check but were forwarded because of the permit permission set up in the ACL. Using the drop count and suppressed drop count statistics, a network administrator can takes steps to isolate the attack at a specific interface.
![]() |
Note Judicious use of ACL logging can further identify the address or addresses that are being dropped by Unicast RPF. |
The following are the benefits of the enhancements to the Unicast Reverse Path Forwarding feature.
Identify the Entry Point for Network Attacks
Per-interface statistics allow the network administrator to quickly determine the network entry point for packets that have malformed or forged source addresses. To gather these statistics, the Unicast Reverse Path Forwarding feature counts the number of dropped or suppressed packets at an interface.
Aid in Diagnosing Network Attacks
Using ACLs to log information about forged packets provides network administrators with a tool for gathering data about network attacks. Using the log information, administrators can see what source addresses are being used in the attack, the time that packets arrived at the interface, and so on.
Supports for Asymmetric Routing
Using ACLs allows the router to accept incoming packets when the best path back to the source is an asymmetric route. ACLs permit the Unicast Reverse Path Forwarding feature to be used when packets are known to be arriving by specific, less optimal asymmetric input paths.
Unicast RPF works only with platforms that support CEF.
Standards
No new or modified standards are supported by this feature.
MIBs
No new or modified MIBs are supported by this feature.
For descriptions of supported MIBs and how to use MIBs, see the Cisco MIB web site on CCO at http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml.
RFCs
RFC 2267, Network Ingress Filtering: Defeating Denial of Service Attacks which employ IP Source Address Spoofing
This documents assumes that you are familiar with the process for configuring the Unicast RPF feature on Cisco routers. For more information about the Unicast RPF feature, refer to the section "Related Documents."
Prior to configuring Unicast RPF, configure ACLs:
If you wish to use the optional Unicast RPF feature, the following sections describe the configuration tasks. Each task in the list is identified as either optional or required for this feature.
For an example of how to configure Unicast RPF with enhancements, refer to the section "Configuration Examples."
To use Unicast RPF, you must configure the router for CEF switching or CEF distributed switching. There is no need to configure the input interface for CEF switching because Unicast RPF has been implemented as a search through the FIB using the source IP address. As long as CEF is running on the router, individual interfaces can be configured with other switching modes. Unicast RPF is an input-side function that is enabled on an interface or subinterface that supports any type of encapsulation and operates on IP packets received by the router. It is very important that CEF be turned on globally in the router---Unicast RPF will not work without CEF.
To configure Unicast RPF, use the following commands beginning in global configuration mode:
| Command | Purpose | |
|---|---|---|
Step 1 | Router(config)#ip ceforRouter(config)#ip cef distributed | Enables CEF or distributed CEF on the router. Distributed CEF is required for routers that use a Route Switch Processor (RSP) and Versatile Interface Processor (VIP). You might want to disable CEF or distributed CEF (dCEF) on a particular interface if that interface is configured with a feature that CEF or dCEF does not support. In this case, you would enable CEF globally, but disable CEF on a specific interface using the no ip route-cache cef interface command, which enables all but that specific interface to use express forwarding. If you have disabled CEF or dCEF operation on an interface and want to reenable it, you can do so by using the iproute-cache cef command in interface configuration mode. |
Router(config-if)#interface type | Selects the input interface on which you want to apply Unicast RPF. This is the receiving interface, which allows Unicast RPF to verify the best return path before forwarding the packet on to the next destination. The interface type is specific to your router and the types of interface cards installed on the router. To display a list of available interface types, enter the interface ? command. | |
Router(config-if)# | Enables Unicast RPF on the interface. Use the list option to identify an access list. If the access list denies network access, spoofed packets are dropped at the interface. If the access list permits network access, spoofed packets are forwarded to the destination address. Forwarded packets are counted in the interface statistics. If the access list includes the logging option, information about the spoofed packets is logged to the log server. Repeat this step for each access list that you want specify. | |
Step4 | Router(config-if)#exit | Exits interface configuration mode. Repeat Steps2 and 3 for each interface on which you want to apply Unicast RPF. |
To verify that Unicast RPF is operational, use the show cef interface command. The following example shows that Unicast RPF is enabled at interface serial2/0/0.
Router-3# show cef interface serial 2/0/0 Serial2/0/0 is up (if_number 8) Internet address is 192.168.10.2/30 ICMP redirects are never sent Per packet loadbalancing is disabled IP unicast RPF check is enabled Inbound access list is not set Outbound access list is not set Interface is marked as point to point interface Packets switched to this interface on linecard are dropped to next slow path Hardware idb is Serial2/0/0 Fast switching type 4, interface type 6 IP Distributed CEF switching enabled IP LES Feature Fast switching turbo vector IP Feature CEF switching turbo vector Input fast flags 0x40, Output fast flags 0x0, ifindex 7(7) Slot 2 Slot unit 0 VC -1 Transmit limit accumulator 0x48001A02 (0x48001A02) IP MTU 1500
To monitor Unicast RPF activity or disable the Unicast RPF feature, use the following commands in privileged EXEC mode:
| Command | Purpose |
|---|---|
Router#show ip traffic | Displays global router statistics about Unicast RPF drops and suppressed drops. |
Router#show ip interface type | Displays per-interface statistics about Unicast RPF drops and suppressed drops. |
Router#show access-lists | Displays the number of matches to a specific ACL. |
Router(config-if)#no ip verify unicast reverse-path list | Disables Unicast RPF at the interface. Use the list option to disable Unicast RPF for a specific ACL at the interface. |
Unicast RPF counts the number of packets dropped or suppressed because of malformed or forged source addresses. The way that Unicast RPF counts dropped or forwarded packets has been extended to include global and per-interface information:
The show ip traffic command shows the total number (global count) of dropped or suppressed packets for all interfaces on the router. The Unicast RPF drop count is included in the IP statistics section.
Router# show ip traffic
IP statistics:
Rcvd: 1471590 total, 887368 local destination
0 format errors, 0 checksum errors, 301274 bad hop count
0 unknown protocol, 0 not a gateway
0 security failures, 0 bad options, 0 with options
Opts: 0 end, 0 nop, 0 basic security, 0 loose source route
0 timestamp, 0 extended security, 0 record route
0 stream ID, 0 strict source route, 0 alert, 0 other
Frags: 0 reassembled, 0 timeouts, 0 couldn't reassemble
0 fragmented, 0 couldn't fragment
Bcast: 205233 received, 0 sent
Mcast: 463292 received, 462118 sent
Sent: 990158 generated, 282938 forwarded
Drop: 3 encapsulation failed, 0 unresolved, 0 no adjacency
0 no route, 0 unicast RPF, 0 forced drop
A nonzero value for the count of dropped or suppressed packets can mean one of two things:
The show ip interface command shows the total of dropped or suppressed packets at a specific interface. If Unicast RPF is configured to use a specific ACL, that ACL information is displayed along with the drop statistics.
Router> show ip interface ethernet0/1/1 Unicast RPF ACL 197 1 unicast RPF drop 1 unicast RPF suppressed drop
The show access-lists command displays the number of matches found for a specific entry in a specific access list.
Router> show access-lists
Extended IP access list 197
deny ip 192.168.201.0 0.0.0.63 any log-input (1 match)
permit ip 192.168.201.64 0.0.0.63 any log-input (1 match)
deny ip 192.168.201.128 0.0.0.63 any log-input
permit ip 192.168.201.192 0.0.0.63 any log-input
The following example demonstrates the use of ACLs and logging with Unicast RPF. In this example, extended ACL 197 provides entries that deny or permit network traffic for specific address ranges. Unicast RPF is configured on interface Ethernet0 to check packets arriving at that interface.
For example, packets with a source address of 192.168.201.10 arriving at interface Ethernet0 are dropped because of the deny statement in ACL 197. In this case, the ACL information is logged (the logging option is turned on for the ACL entry) and dropped packets are counted per interface and globally. Packets with a source address of 192.168.201.100 arriving at interface Ethernet0 are forwarded because of the permit statement in ACL 197. ACL information about dropped or suppressed packets is logged (logging option turned on for the ACL entry) to the log server.
ip cef distributed ! int eth0/1/1 ip address 192.168.200.1 255.255.255.0 ip verify unicast reverse-path 197 ! int eth0/1/2 ip address 192.168.201.1 255.255.255.0 ! access-list 197 deny ip 192.168.201.0 0.0.0.63 any log-input access-list 197 permit ip 192.168.201.64 0.0.0.63 any log-input access-list 197 deny ip 192.168.201.128 0.0.0.63 any log-input access-list 197 permit ip 192.168.201.192 0.0.0.63 any log-input access-list 197 deny ip host 0.0.0.0 any log
This section documents modifications to the ip verify unicast rpf command that configures the Unicast Reverse Path Forwarding feature.
To enable Unicast Reverse Path Forwarding (Unicast RPF), use the ip verify unicast reverse-path interface configuration command. To disable Unicast RPF, use the no form of this command.
ip verify unicast reverse-path [list]
Syntax Description
list Specifies a numbered access control list (ACL) in the following ranges:
Defaults
Unicast RPF is disabled.
Command Modes
Interface configuration mode
Command History
11.1(CC), 12.0 This command was introduced. This command was not included in Cisco IOS Release 11.2 or 11.3 12.1(2)T Added ACL support using the list argument. Added per-interface statistics on dropped or suppressed packets.
Release
Modification
Usage Guidelines
Use the ip verify unicast reverse-path interface command to mitigate problems caused by malformed or forged (spoofed) IP source addresses that pass through a router. Malformed or forged source addresses can indicate denial-of-service (DoS) attacks based on source IP address spoofing.
When Unicast RPF is enabled on an interface, the router examines all packets received on that interface. The router checks to make sure that the source address appears in the routing table and matches the interface on which the packet was received. This "look backwards" ability is available only when Cisco Express Forwarding (CEF) is enabled on the router because the lookup relies on the presence of the Forwarding Information Base (FIB). CEF generates the FIB as part of its operation.
![]() |
NoteUnicast RPF is an input function and is applied only on the input interface of a router at the upstream end of a connection. |
The Unicast Reverse Path Forwarding feature checks to see if any packet received at a router interface arrives on one of the best return paths to the source of the packet. The feature does this by doing a reverse lookup in the CEF table. If Unicast RPF does not find a reverse path for the packet, Unicast RPF can drop or forward the packet, depending on whether an ACL is specified in the Unicast Reverse Path Forwarding command. If an ACL is specified in the command, then when (and only when) a packet fails the Unicast RPF check, the ACL is checked to see if the packet should be dropped (using a deny statement in the ACL) or forwarded (using a permit statement in the ACL). Whether a packet is dropped or forwarded, the packet is counted in the global IP traffic statistics for Unicast RPF drops and in the interface statistics for Unicast RPF.
If no ACL is specified in the Unicast Reverse Path Forwarding command, the router drops the forged or malformed packet immediately and no ACL logging occurs. The router and interface Unicast RPF counters are updated.
Unicast RPF events can be logged by specifying the logging option for the ACL entries used by the Unicast Reverse Path Forwarding command. Log information can be used to gather information about the attack, such as source address, time, and so on.
![]() |
NoteWith Unicast RPF, all equal-cost "best" return paths are considered valid. This means that Unicast RPF works in cases where multiple return paths exist, provided that each path is equal to the others in terms of the routing cost (number of hops, weights, and so on) and as long as the route is in the FIB. Unicast RPF also functions where Enhanced Internet Gateway Routing Protocol (EIGRP) variants are being used and unequal candidate paths back to the source IP address exist. |
To use Unicast RPF, enable CEF switching or distributed CEF (dCEF) switching in the router. There is no need to configure the input interface for CEF switching. As long as CEF is running on the router, individual interfaces can be configured with other switching modes.
![]() |
NoteIt is very important for CEF to be configured globally in the router. Unicast RPF will not work without CEF. |
Unicast RPF should not be used on interfaces that are internal to the network. Internal interfaces are likely to have routing asymmetry, meaning that there are multiple routes to the source of a packet. Unicast RPF should be applied only where there is natural or configured symmetry.
For example, routers at the edge of the network of an Internet service provider (ISP) are more likely to have symmetrical reverse paths than routers that are in the core of the ISP network. Routers that are in the core of the ISP network have no guarantee that the best forwarding path out of the router will be the path selected for packets returning to the router. Hence, it is not recommended that you apply Unicast RPF where there is a chance of asymmetric routing. It is simplest to place Unicast RPF only at the edge of a network or, for an ISP, at the customer edge of the network.
Examples
The following example shows enabling the Unicast Reverse Path Forwarding feature on a serial interface:
ip cef ! or "ip cef distributed" for RSP+VIP based routers ! interface serial 5/0/0 ip verify unicast reverse-path
The following example uses a very simple single-homed ISP to demonstrate the concepts of ingress and egress filters used in conjunction with Unicast RPF. The example illustrates an ISP-allocated classless interdomain routing (CIDR) block 209.165.202.128/28 that has both inbound and outbound filters on the upstream interface. Be aware that ISPs are usually not single-homed. Hence, provisions for asymmetrical flows (when outbound traffic goes out one link and returns via a different link) need to be designed into the filters on the border routers of the ISP.
ip cef distributed ! interface Serial 5/0/0 description Connection to Upstream ISP ip address 209.165.200.225 255.255.255.252 no ip redirects no ip directed-broadcast no ip proxy-arp ip verify unicast reverse-path ip access-group 111 in ip access-group 110 out ! access-list 110 permit ip 209.165.202.128 0.0.0.31 any access-list 110 deny ip any any log access-list 111 deny ip host 0.0.0.0 any log access-list 111 deny ip 127.0.0.0 0.255.255.255 any log access-list 111 deny ip 10.0.0.0 0.255.255.255 any log access-list 111 deny ip 172.16.0.0 0.15.255.255 any log access-list 111 deny ip 192.168.0.0 0.0.255.255 any log access-list 111 deny ip 209.165.202.128 0.0.0.31 any log access-list 111 permit ip any any
The following example demonstrates the use of ACLs and logging with Unicast RPF. In this example, extended ACL 197 provides entries that deny or permit network traffic for specific address ranges. Unicast RPF is configured on interface Ethernet0 to check packets arriving at that interface.
For example, packets with a source address of 192.168.201.10 arriving at interface Ethernet0 are dropped because of the deny statement in ACL 197. In this case, the ACL information is logged (the logging option is turned on for the ACL entry) and dropped packets are counted per-interface and globally. Packets with a source address of 192.168.201.100 arriving at interface Ethernet0 are forwarded because of the permit statement in ACL 197. ACL information about dropped or suppressed packets is logged (the logging option is turned on for the ACL entry) to the log server.
ip cef distributed ! int eth0/1/1 ip address 192.168.200.1 255.255.255.0 ip verify unicast reverse-path 197 ! int eth0/1/2 ip address 192.168.201.1 255.255.255.0 ! access-list 197 deny ip 192.168.201.0 0.0.0.63 any log-input access-list 197 permit ip 192.168.201.64 0.0.0.63 any log-input access-list 197 deny ip 192.168.201.128 0.0.0.63 any log-input access-list 197 permit ip 192.168.201.192 0.0.0.63 any log-input access-list 197 deny ip host 0.0.0.0 any log-input access-list 197 deny ip 127.0.0.0 0.255.255.255 any log-input access-list 197 deny ip 10.0.0.0 0.255.255.255 any log-input access-list 197 deny ip 172.16.0.0 0.15.255.255 any log-input access-list 197 deny ip 192.168.0.0 0.0.255.255 any log-input
Related Commands
ip cef Enables CEF on the route processor card.
Command
Description
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Wed May 24 11:54:07 PDT 2000
Copyright 1989 - 2000©Cisco Systems Inc.