VPN Routing and Forwarding
VPN Routing and Forwarding
VPN Routing and Forwarding
Address
The VPN Routing and Forwarding (VRF) Selection feature allows a specified interface on a provider
edge (PE) router to route packets to different Virtual Private Networks (VPNs) based on the source IP
address of the packet. This feature is an improvement over using a policy-based router to route packets
to different VPNs.
Feature History for MPLS VPN: VRF Selection Based on Source IP Address
Release Modification
12.0(22)S This feature was introduced on the Cisco 12000 series router
12.0(23)S This feature was updated to support the following line cards:
• 1-port 10-Gigabit Ethernet (E4+)
• 3-port Gigabit Ethernet
• Modular Gigabit Ethernet (E4+)
12.0(24)S Support for the Cisco 12000 series router engine 3 was added.
12.2(14)SZ This feature was integrated into Cisco IOS Release 12.2(14)SZ to support
the Cisco 7304 router.
12.2(18)S This feature was integrated into Cisco IOS Release 12.2(18)S to support
the Cisco 7304 router.
12.0(26)S This feature was integrated into Cisco IOS Release 12.0(26)S to support
the Cisco 7200 and 7500 series routers.
12.2(25)S This feature was integrated into Cisco IOS Release 12.2(25)S to support
the Cisco 7200 and 7500 series routers.
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image
support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on
Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at
the login dialog box and follow the instructions that appear.
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
1
MPLS VPN: VRF Selection Based on Source IP Address
Contents
Contents
This document includes the following sections:
• Prerequisites for MPLS VPN: VRF Selection Based on Source IP Address, page 2
• Restrictions for MPLS VPN: VRF Selection Based on Source IP Address, page 3
• Information About MPLS VPN: VRF Selection Based on Source IP Address, page 3
• How to Configure VRF Selection Based on Source IP Address, page 8
• Configuration Examples for VRF Selection Based on Source IP Address, page 12
• Additional References, page 15
• Command Reference, page 16
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
2
MPLS VPN: VRF Selection Based on Source IP Address
Restrictions for MPLS VPN: VRF Selection Based on Source IP Address
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
3
MPLS VPN: VRF Selection Based on Source IP Address
Information About MPLS VPN: VRF Selection Based on Source IP Address
• The second table, the VRF table (also known as the VPN routing table), contains the virtual routing
and forwarding information for the specified VPN and is used to forward the selected VPN traffic
to the correct MPLS label switched path (LSP) based upon the destination IP address of the packet.
The VRF Selection process removes the association between the VPN and the interface and allows more
than one MPLS VPN to be associated with the interface.
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
4
MPLS VPN: VRF Selection Based on Source IP Address
Information About MPLS VPN: VRF Selection Based on Source IP Address
Internet
vpnv4
ISP 1 or VPN1
PE1-VRF 1.1.0.0/16
selector Carrier X
MPLS-VPN CE1
network
PE
ISP 2 or VPN2
vpnv4 2.2.0.0/16
P
POS1/0
CE2
PE2-VRF
selector
ISP 3 or VPN3
3.3.0.0/16
IP only 1
Carrier X "POOL" CE3
(IP only) network IP only
2
72793
Host A Host B Host C
1.1.1.1 2.2.2.2 3.3.3.3
Pool of cable modem
subscribers
1 PE2 is acting both as a VRF selector and a 2 ISPs 1 to 3 provide a list of IP addresses to
typical MPLS VPN PE router to CE2 and Carrier X so that each host in the “POOL”
CE3. network can be properly addressed. This host
addressing would most likely be done by
using the DHCP or DNS services of Carrier X.
In Figure 1, Carrier X represents the network carrier; Host A, Host B and Host C represent the carrier
subscribers; and ISP 1, ISP 2 and ISP 3 represent the ISPs.
Figure 1 illustrates a packet traveling from Host A to ISP 1. The dashed line represents the travel of the
packet.
Host A chooses ISP 1 to use as its ISP. Carrier X will provide an IP address to Host A that falls within
the range of the ISP 1 registered network addresses (1.1.0.0/16). Based upon this IP address allocation,
the VRF Selection criteria is set.
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
5
MPLS VPN: VRF Selection Based on Source IP Address
Information About MPLS VPN: VRF Selection Based on Source IP Address
The POOL network, by using default routes, forwards traffic from the Carrier X IP-based (POOL)
network to the Carrier X MPLS-based VPN network. The MPLS VPN network forwards (shunts) the
traffic from Host A into the correct VPN, which is VPN 1 (ISP 1), by using the VRF Selection-enabled
router PE2.
To enable the VRF Selection feature on the routers PE1 and PE2, enter the following commands:
Router(config)# vrf selection source 1.1.0.0 255.255.0.0 vrf vpn1
Router(config)# vrf selection source 2.2.0.0 255.255.0.0 vrf vpn2
Router(config)# interface POS1/0
Router(config-if)# description Link to CE POS1/0
Router(config-if)# ip vrf select source
For more information on the commands used to configure the VRF Selection feature, see the “Command
Reference” section on page 16.
The VRF Selection feature is a one-way (unidirectional) feature in most implementations; it only works
on packets coming from the customer networks to a PE router. See the “VRF Selection is a
Unidirectional Feature” section on page 6 for more information.
Traffic coming from the ISPs to the hosts (in the example, traffic traveling from the ISPs on the right to
the hosts on the left) is not affected by the VRF Selection feature and does not have to be returned via
an MPLS path. This traffic can return via the shortest available IP path.
Another example of VRF Selection in use would be a Cable Modem Termination System (CMTS). If the
owner of the CMTS wants to allow cable modem subscribers to choose their ISP from a group of ISPs,
the VRF Selection feature provides a fast and scalable solution.
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
6
MPLS VPN: VRF Selection Based on Source IP Address
Information About MPLS VPN: VRF Selection Based on Source IP Address
Normal IP-based VPN operations, such as populating the Routing Information Base (RIB) and
Forwarding Information Base (FIB) from a routing protocol such as Border Gateway Protocol (BGP),
are used to route and forward packets within the various VPNs in the customer networks. The provider
network uses MPLS-based routing protocols to perform VPN routing and forwarding inside the provider
network.
See the “Configuring VRF Selection” section on page 9 for a sample configuration of the VRF Selection
feature.
MPLS Network
Host A MPLS VPN ISP1
VLAN
CE1
Host B
CE PBR PE P PE
Host C Router ISP2
CE2
ISP3
72516
CE3
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
7
MPLS VPN: VRF Selection Based on Source IP Address
How to Configure VRF Selection Based on Source IP Address
The following limitations apply to PBR-based solutions that use this implementation:
• Policy routing and MPLS VPN functions cannot be performed on the same platform. Integration into
a single platform is critical for manageability and support.
• VRF is limited to one VPN per interface, which limits scalability.
• There is no network redundancy.
• The PBR is the only point of connection for all the networks attached to the PBR. The capacity and
the performance capabilities of the PBR router are critical.
• There is no diversity in the connectivity to the networks.
• Every network is required to connect to every PBR. If every network is not connected to every PBR,
packets from the end user to the PBR would be dropped because the PBR would have no way of
switching the IP traffic properly.
• Adding multiple PBRs that are interconnected introduces more network policy-routed hops.
The VRF Selection feature addresses the limitations of and problems with using a PBR for packet
routing and forwarding.
Access to every customer network is possible from every PE router in the provider network
Access points to each network can be established at any MPLS PE router, and can be made redundant
by connections to multiple PE routers (for example, the CE2 router in Figure 1 on page 5).
Multiple points in the provider network can be used for VPN routing and forwarding
MPLS VPNs, like IP, are connectionless. Any PE router, whether VRF Selection-enabled or not, is
capable of carrying VRF Selection traffic from the MPLS network out to the CE routers.
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
8
MPLS VPN: VRF Selection Based on Source IP Address
How to Configure VRF Selection Based on Source IP Address
SUMMARY STEPS
1. enable
2. configure terminal
3. vrf selection source source-IP-address source-IP-mask vrf vrf_name
4. ip vrf select source
5. ip vrf receive vrf_name
DETAILED STEPS
Command Purpose
Step 1 enable Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Router> enable
Step 2 configure terminal Enters global configuration mode.
Example:
Router# configure terminal
Step 3 vrf selection source source-IP-address Populates a single source IP address, or range of source IP
source-IP-mask vrf vrf_name addresses, to a VRF Selection table.
Example:
Router(config)# vrf selection source
2.0.0.0 255.255.0.0 vrf test
Step 4 ip vrf select source Enables the VRF Selection feature on an interface.
Example:
Router(config-if)# ip vrf select source
Step 5 ip vrf receive vrf_name Adds all the IP addresses that are associated with an interface into
a VRF table.
Example:
Router(config-if)# ip vrf receive red
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
9
MPLS VPN: VRF Selection Based on Source IP Address
How to Configure VRF Selection Based on Source IP Address
VPN static routes for traffic returning to the customer networks are only necessary if VPN traffic
returning to the customer networks is being forwarded back from the VRF Selection interface. The
remote PE router could also be configured to route return traffic to the customer networks directly by
using the global routing table.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip route vrf vrf_name prefix mask [next-hop-address] [interface {interface-number}] [global]
[distance] [permanent] [tag tag]
DETAILED STEPS
Command Purpose
Step 1 enable Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Router> enable
Step 2 configure terminal Enters global configuration mode.
Example:
Router# configure terminal
Step 3 ip route vrf vrf_name prefix mask Establishes static routes for a VRF.
[next-hop-address] [interface
{interface-number}] [global] [distance]
[permanent] [tag tag]
Example:
Router(config-if)# ip route vrf vpn1
16.15.0.0 255.255.0.0 POS1/0
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
10
MPLS VPN: VRF Selection Based on Source IP Address
How to Configure VRF Selection Based on Source IP Address
Troubleshooting Tips
• Enter the debug vrf select command to enable debugging for the VRF Selection feature.
Note The debug vrf select command can cause many messages to be logged when you change the
configuration and when switching occurs.
• The following error messages appear if problems occur while configuring the VRF Selection
feature:
– If you attempt to configure a nonexisting VRF Selection table:
Router(config)#vrf selection source 2.0.0.0 255.255.0.0 vrf VRF_NOEXIST
VRF Selection: VRF table VRF_NOEXIST does not exist.
– If you attempt to remove a VRF Selection entry that does not exist:
Router(config)#no vrf selection source 2.0.0.0 255.255.0.0 vrf VRF1
VRF Selection: Can't find the node to remove.
– If you attempt to configure a duplicate IP address and subnet mask for a VRF Selection entry:
Router(config)#vrf selection source 2.0.0.0 255.0.0.0 vrf VRF_AOL
Router(config)#vrf selection source 2.0.0.0 255.0.0.0 vrf VRF_AOL
VRF Selection: duplicate address and mask configured.
– If an inconsistent IP address and mask are used for a VRF Selection entry:
Router(config)#vrf selection source 170.1.2.1 255.255.255.0 vrf red
% Inconsistent address and mask
Router(config)#vrf selection source 170.1.2.1 255.255.255.255 vrf red
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
11
MPLS VPN: VRF Selection Based on Source IP Address
Configuration Examples for VRF Selection Based on Source IP Address
– If you attempt to configure a VRF instance on an interface that has VRF Selection already
configured:
Router(config-if)#ip vrf select source
Router(config-if)#ip vrf forward red
% Can not configure VRF if VRF Select is already configured
To enable VRF, first remove VRF Select from the interface
– If you attempt to configure a VRF Selection entry on an interface that has VRF already
configured:
Router(config-if)#ip vrf forward red
Router(config-if)#ip vrf select source
% Can not configure VRF Select if interface is under a non-global VRF
To enable VRF Select, first remove VRF from the interface
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
12
MPLS VPN: VRF Selection Based on Source IP Address
Configuration Examples for VRF Selection Based on Source IP Address
Router(config-vrf)# exit
Router(config)# ip vrf vpn2
Router(config-vrf)# rd 1000:2
Router(config-vrf)# route-target export 1000:2
Router(config-vrf)# route-target export 1000:2
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
13
MPLS VPN: VRF Selection Based on Source IP Address
Configuration Examples for VRF Selection Based on Source IP Address
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
14
MPLS VPN: VRF Selection Based on Source IP Address
Additional References
Additional References
The following sections provide references related to <<Feature>>.
Related Documents
Related Topic Document Title
MPLS VPNs MPLS Virtual Private Networks
Standards
Standards Title
None —
MIBs
MIBs MIBs Link
• None To locate and download MIBs for selected platforms, Cisco IOS
releases, and feature sets, use Cisco MIB Locator found at the
following URL:
http://www.cisco.com/go/mibs
RFCs
RFCs Title
None —
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
15
MPLS VPN: VRF Selection Based on Source IP Address
Command Reference
Technical Assistance
Description Link
Technical Assistance Center (TAC) home page, http://www.cisco.com/public/support/tac/home.shtml
containing 30,000 pages of searchable technical
content, including links to products, technologies,
solutions, technical tips, and tools. Registered
Cisco.com users can log in from this page to access
even more content.
Command Reference
This section provides new commands. All other commands used with the VRF Selection feature are
documented in the Cisco IOS Release 12.2 command reference publications.
New Commands
• ip vrf receive
• ip vrf select source
• vrf selection source
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
16
MPLS VPN: VRF Selection Based on Source IP Address
ip vrf receive
ip vrf receive
To add all the IP addresses that are associated with an interface into a VRF table, use the ip vrf receive
command in interface configuration mode. To remove the IP addresses from the VRF table, use the no
form of this command.
Syntax Description vrf_name Name of the VRF table to which the IP addresses of the interface will be
added.
Usage Guidelines This command adds all the IP addresses that are associated with an interface into a VRF table. These IP
address entries will then be inserted as a connected route and will appear as “receive” entries in the CEF
table.
Interfaces where the VRF Selection feature is enabled will forward packets that have an IP address that
corresponds to an IP address entry in the VRF table. If the VRF table does not contain a matching IP
address, the packet will, by default, be dropped because there is no corresponding “receive” entry in the
VRF CEF entry.
The ip vrf receive command allows the IP addresses that are associated with an interface to be inserted
as a connected route into a particular VRF. Once the IP addresses are inserted as a connected route, the
interface is allowed to respond to requests (such as a ping request) directed to it from a VPN.
This command can be entered once on an interface to add IP addresses to one VRF table, or can be
entered multiple times to add the IP addresses to more than one VRF table.
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
17
MPLS VPN: VRF Selection Based on Source IP Address
ip vrf receive
The IP address does not have to be specified in this command; the IP address and any secondary
addresses associated with the interface will be automatically entered into the VRF table.
Examples The following example shows how to add the IP addresses associated with the interface into the VRF
table vpn1:
Router(config-if)# ip vrf receive vpn1
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
18
MPLS VPN: VRF Selection Based on Source IP Address
ip vrf select source
Usage Guidelines The ip vrf select source and ip vrf forwarding commands are mutually exclusive. If the VRF Selection
feature is configured on an interface, you cannot configure VRFs (using the ip vrf forwarding
command) on the same interface.
Examples The following example shows how to enable the VRF Selection feature on an interface:
Router(config-if)# ip vrf select source
The following example shows the message you receive after you have deleted the VRF Selection feature
on an interface:
Enter configuration commands, one per line. End with CNTL/Z.
Router (config)# int pos4/0
Router (config-if)# no ip vrf select source
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
19
MPLS VPN: VRF Selection Based on Source IP Address
ip vrf select source
Router (config-if)#
INTERFACE_VRF_SELECT unset for POS4/0, slot: 4
Router (config-if)#
The following example shows the message you receive after you have enabled the VRF Selection feature
on an interface:
Router (config-if)#
Router (config-if)# ip vrf select source
Router (config-if)#
INTERFACE_VRF_SELECT set for POS4/0, slot: 4
Router (config-if)#
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
20
MPLS VPN: VRF Selection Based on Source IP Address
vrf selection source
Syntax Description source-IP-address New source IP address to be added to the VRF Selection table.
source-IP-mask IP mask for the source IP address or range of single source IP addresses to
be added to the VRF Selection table.
vrf vrf_name Name of the VRF Selection table to which the single source IP address or
range of source IP addresses should be added.
Usage Guidelines If a VRF table is removed by using the no ip vrf vrf_name command in global configuration mode, all
configurations associated with that VRF will be removed including those configurations added with the
vrf selection source command.
Examples The following example shows how to populate the VRF Selection table vpn1 with a source IP network
address 10.0.0.0 and the IP mask 255.0.0.0, which would forward any packets with the source IP address
10.0.0.0 into the VRF instance vpn1:
Router(config)# vrf selection source 10.0.0.0 255.0.0.0 vrf vpn1
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
21
MPLS VPN: VRF Selection Based on Source IP Address
vrf selection source
The following example shows the message you receive after you have removed the source IP network
address 17.1.1.1 and the IP mask 255.255.255.255 from the VRF Selection table vpn1:
Router (config)# no vrf selection source 17.1.1.1 255.255.255.255 vrf vpn1
Router (config)#
VRF Selection Configuration: addr:17.1.1.1, mask:255.255.255.255, vrf_name:vpn1
The following example shows the message you receive after you have added the source IP network
address 17.1.1.1 and the IP mask 255.255.255.255 to the VRF Selection table vpn1:
Router (config)# vrf selection source 17.1.1.1 255.255.255.255 vrf vpn1
Router (config)#
VRF Selection Configuration: addr:17.1.1.1, mask:255.255.255.255, vrf_name:vpn1
VRF Selection: VRF table vpn1, id is: 1
CCSP, the Cisco Square Bridge logo, Cisco Unity, Follow Me Browsing, FormShare, and StackWise are trademarks of Cisco Systems, Inc.; Changing
the Way We Work, Live, Play, and Learn, and iQuick Study are service marks of Cisco Systems, Inc.; and Aironet, ASIST, BPX, Catalyst, CCDA, CCDP,
CCIE, CCIP, CCNA, CCNP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the
Cisco Systems logo, Empowering the Internet Generation, Enterprise/Solver, EtherChannel, EtherFast, EtherSwitch, Fast Step, GigaDrive, GigaStack,
HomeLink, Internet Quotient, IOS, IP/TV, iQ Expertise, the iQ logo, iQ Net Readiness Scorecard, LightStream, Linksys, MeetingPlace, MGX, the
Networkers logo, Networking Academy, Network Registrar, Packet, PIX, Post-Routing, Pre-Routing, ProConnect, RateMUX, Registrar, ScriptShare,
SlideCast, SMARTnet, StrataView Plus, SwitchProbe, TeleRouter, The Fastest Way to Increase Your Internet Quotient, TransPath, and VCO are
registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or Website 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. (0406R)
Cisco IOS Releases 12.0(22)S, 12.0(23)S, 12.0(24)S, 12.2(14)SZ, 12.2(18)S, 12.0(26)S, 12.2(25)S
22