- Finding Feature Information
- Prerequisites for VRF Selection Using Policy-Based Routing
- Restrictions for VRF Selection Using Policy-Based Routing
- Information About VRF Selection Using Policy-Based Routing
- How to Configure VRF Selection Using Policy-Based Routing
- Configuration Examples for VRF Selection Using Policy-Based Routing
MPLS VPN VRF Selection Using Policy-Based Routing
The MPLS VPN: VRF Selection Using Policy-Based Routing feature is an extension of the MPLS VPN: VRF Selection Based on Source IP Address feature. This feature introduces a policy-based routing (PBR) mechanism to classify and forward Virtual Private Network (VPN) traffic based on multiple VPN routing and forwarding (VRF) selection match criteria.
- Finding Feature Information
- Prerequisites for VRF Selection Using Policy-Based Routing
- Restrictions for VRF Selection Using Policy-Based Routing
- Information About VRF Selection Using Policy-Based Routing
- How to Configure VRF Selection Using Policy-Based Routing
- Configuration Examples for VRF Selection Using Policy-Based Routing
- Additional References
- Feature Information for VRF Selection Using Policy-Based Routing
- Glossary
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Prerequisites for VRF Selection Using Policy-Based Routing
The router must support PBR to configure this feature. For platforms that do not support PBR, use the "VRF Selection Based on Source IP Address" feature introduced in Cisco IOS Release 12.0(22)S.
A VRF must be defined prior to the configuration of this feature. An error message is displayed on the console if no VRF exists.
This document assumes that multiprotocol BGP (mBGP), Multiprotocol Label Switching (MPLS), and Cisco Express Forwarding are enabled in your network.
Restrictions for VRF Selection Using Policy-Based Routing
The VRF Selection Using Policy-Based Routing feature is supported only in service provider (-p-) images.
The VRF Selection Using Policy-Based Routing feature can coexist with the VRF Selection Based on Source IP address feature on the same router, but these features cannot be configured together on the same interface. This is designed behavior to prevent VRF table selection conflicts that could occur if these features were misconfigured together. An error message is displayed on the console if you attempt to configure the ip vrf select source and the ip policy route-map commands on the same interface.
Protocol Independent Multicast (PIM) and multicast packets do not support PBR and cannot be configured for a source IP address that is a match criterion for this feature.
The VRF Selection Using Policy-Based Routing feature cannot be configured with IP prefix lists.
Information About VRF Selection Using Policy-Based Routing
Introduction to VRF Selection Using Policy-Based Routing
The VRF Selection Using Policy-Based Routing feature is an extension of the VRF Selection Based on Source IP Address feature. The PBR implementation of the VRF selection feature allows you to policy route VPN traffic based on match criteria. Match criteria are defined in an IP access list or based on packet length. The following match criteria are supported in Cisco software:
- IP access lists--Define match criteria based on IP addresses, IP address ranges, and other IP packet access list filtering options. Named, numbered, standard, and extended access lists are supported. All IP access-list configuration options in Cisco software can be used to define match criteria.
- Packet lengths--Define match criteria based on the length of a packet in bytes. The packet length filter is defined in a route map with the match length route-map configuration command.
Policy routing is defined in the route map. The route map is applied to the incoming interface with the ip policy route-map interface configuration command. An IP access list is applied to the route map with the match ip address route-map configuration command. Packet length match criteria are applied to the route map with the match length route-map configuration command. The set action is defined with the set vrf route-map configuration command. The match criteria are evaluated, and the appropriate VRF is selected by the set clause. This combination allows you to define match criteria for incoming VPN traffic and policy route VPN packets out to the appropriate VRF.
Policy-Based Routing Set Clauses Overview
When you are configuring PBR, the following four set clauses can be used to change normal routing and forwarding behavior:
- set default interface
- set interface
- set ip default next-hop
- set ip next-hop
Configuring any of the set clauses will overwrite normal routing forwarding behavior of a packet.
The VRF Selection Using Policy-Based Routing feature introduces the fifth set clause that can be used to change normal routing and forwarding behavior. The set vrf command is used to select the appropriate VRF after the successful match occurs in the route map.
How to Configure VRF Selection Using Policy-Based Routing
- Defining the Match Criteria for PBR VRF Selection Based on Packet Length
- Configuring PBR VRF Selection in a Route Map
- Configuring PBR on the Interface
- Configuring IP VRF Receive on the Interface
- Verifying the Configuration of the VRF Selection Using Policy-Based Routing
Defining the Match Criteria for PBR VRF Selection Based on Packet Length
The match criteria for PBR VRF route selection are defined in an access list. Standard and named access lists are supported. Match criteria can also be defined based on the packet length using the match length route-map configuration command. This configuration option is defined entirely within a route map.
- Prerequisites
- Configuring PBR VRF Selection with a Standard Access List
- Configuring PBR VRF Selection with a Named Access List
Prerequisites
Before you perform this task, make sure that the VRF and associated IP address are already defined.
Configuring PBR VRF Selection with a Standard Access List
Use the following commands to create a standard access list and define the PBR VRF route selection match criteria in it in order to permit or deny the transmission of VPN traffic data packets.
DETAILED STEPS
Configuring PBR VRF Selection with a Named Access List
Use the following commands to define the PBR VRF route selection match criteria in a named access list in order to permit or deny the transmission of VPN traffic data packets.
DETAILED STEPS
Configuring PBR VRF Selection in a Route Map
Use the following commands to configure the VRF through which the outbound VPN packets will be policy routed in order to permit or deny the transmission of VPN traffic data packets.
Incoming packets are filtered through the match criteria that are defined in the route map. After a successful match occurs, the set vrf command configuration determines the VRF through which the outbound VPN packets will be policy routed.
- The VRF must be defined prior to the configuration of the route map; otherwise an error message is displayed on the console.
- A receive entry must be added to the VRF selection table with the ip vrf receive command. If a match and set operation occurs in the route map but there is no receive entry in the local VRF table, the packet will be dropped if the packet destination is local.
DETAILED STEPS
Configuring PBR on the Interface
Use the following commands to filter incoming VPN traffic data packets. Incoming packets are filtered through the match criteria that are defined in the route map.
The route map is applied to the incoming interface. The route map is attached to the incoming interface with the ip policy route-map global configuration command.
DETAILED STEPS
Configuring IP VRF Receive on the Interface
Use the following commands to insert the IP address of an interface as a connected route entry in a VRF routing table. This will prevent dropped packets.
The source IP address must be added to the VRF selection table. VRF selection is a one-way (unidirectional) feature. It is applied to the incoming interface. If a match and set operation occurs in the route map but there is no VRF receive entry in the local VRF table, the packet will be dropped if the packet destination is local.
DETAILED STEPS
Verifying the Configuration of the VRF Selection Using Policy-Based Routing
To verify the configuration of the VRF Selection Using Policy-Based Routing feature, perform each of the following steps in this section in the order specified.
DETAILED STEPS
Configuration Examples for VRF Selection Using Policy-Based Routing
- Example Defining PBR VRF Selection in Access List
- Example Verifying VRF Selection Using Policy-Based Routing
Example Defining PBR VRF Selection in Access List
In the following example, three standard access lists are created to define match criteria for three different subnets. Any packets received on the FastEthernet 0/1/0 interface will be policy routed through the PBR-VRF-Selection route map to the VRF that is matched in the same route map sequence. If the source IP address of the packet is part of the 10.1.0.0/24 subnet, VRF1 will be used for routing and forwarding.
access-list 40 permit 10.1.0.0 0.0.255.255 access-list 50 permit 10.2.0.0 0.0.255.255 access-list 60 permit 10.3.0.0 0.0.255.255 route-map PBR-VRF-Selection permit 10 match ip address 40 set vrf VRF1 ! route-map PBR-VRF-Selection permit 20 match ip address 50 set vrf VRF2 ! route-map PBR-VRF-Selection permit 30 match ip address 60 set vrf VRF3 ! interface FastEthernet0/1/0 ip address 10.1.0.0/24 255.255.255.252 ip policy route-map PBR-VRF-Selection ip vrf receive VRF1 ip vrf receive VRF2 ip vrf receive VRF3
Example Verifying VRF Selection Using Policy-Based Routing
The following verification examples show defined match criteria and route-map policy configuration.
Verifying Match Criteria
To verify the configuration of match criteria for PBR VRF selection, use the show ip access-list command.
The following show ip access-list command output displays three subnet ranges defined as match criteria in three standard access lists:
Router# show ip access-list
Standard IP access list 40
10 permit 10.1.0.0, wildcard bits 0.0.255.255
Standard IP access list 50
10 permit 10.2.0.0, wildcard bits 0.0.255.255
Standard IP access list 60
10 permit 10.3.0.0, wildcard bits 0.0.255.255
Verifying Route-Map Configuration
To verify route-map configuration, use the show route-map command. The output displays the match criteria and set action for each route-map sequence. The output also displays the number of packets and bytes that have been policy routed per each route-map sequence.
Router# show route-map route-map PBR-VRF-Selection, permit, sequence 10 Match clauses: ip address (access-lists): 40 Set clauses: vrf VRF1 Policy routing matches: 0 packets, 0 bytes route-map PBR-VRF-Selection, permit, sequence 20 Match clauses: ip address (access-lists): 50 Set clauses: vrf VRF2 Policy routing matches: 0 packets, 0 bytes route-map PBR-VRF-Selection, permit, sequence 30 Match clauses: ip address (access-lists): 60 Set clauses: vrf VRF3 Policy routing matches: 0 packets, 0 bytes
Verifying PBR VRF Selection Policy
The following show ip policy command output displays the interface and associated route map that is configured for policy routing:
Router# show ip policy
Interface Route map
FastEthernet0/1/0 PBR-VRF-Selection
Additional References
Related Documents
Related Topic |
Document Title |
---|---|
VRF selection based on the source IP address |
Directing MPLS VPN Traffic Using a Source IP Address |
Standards
Standard |
Title |
---|---|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature |
-- |
MIBs
MIB |
MIBs Link |
---|---|
No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature. |
To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL: |
RFCs
RFC |
Title |
---|---|
No new or modified RFCs are supported by this feature, and support for existing standards has not been modified by this feature. |
-- |
Technical Assistance
Description |
Link |
---|---|
The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies. To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds. Access to most tools on the Cisco Support website requires a Cisco.com user ID and password. |
Feature Information for VRF Selection Using Policy-Based Routing
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1 | Feature Information for VRF Selection Using Policy-Based Routing |
Feature Name |
Releases |
Feature Information |
---|---|---|
MPLS VPN: VRF Selection Using Policy-Based Routing |
12.3(7)T 12.2(25)S 12.2(33)SRB 12.2(33)SXI |
The MPLS VPN: VRF Selection Using Policy-Based Routing feature is an extension of the MPLS VPN: VRF Selection Based on Source IP Address feature. This feature introduces a policy-based routing (PBR) mechanism to classify and forward Virtual Private Network (VPN) traffic based on multiple VPN routing and forwarding (VRF) selection match criteria. In 12.3(7)T, this feature was introduced. This feature was integrated into Cisco IOS Release 12.2(25)S. This feature was integrated into Cisco IOS Release 12.2(33)SRB. This feature was integrated into Cisco IOS Release 12.2(33)SXI. The following commands were introduced or modified: ip vrf receive, set vrf. |
Glossary
PBR --policy-based routing.
VPN --Virtual Private Network.
VRF --virtual routing and forwarding.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.