Configuring Route Maps to Control the Distribution of MPLS Labels Between Routers in an MPLS VPN
Route maps enable you to specify which routes are distributed with Multiprotocol Label Switching (MPLS) labels. Route maps also enable you to specify which routes with MPLS labels a router receives and adds to its Border Gateway Protocol (BGP) table.
Module History
This module was first published on May 2, 2005, and last updated on May 2, 2005.
Finding Feature Information in This Module
Your Cisco IOS software release may not support all features. To find information about feature support and configuration, use the "Feature Information for Route Maps in MPLS VPNs" section.
Contents
•Restrictions for Using Route Maps with MPLS VPNs
•Prerequisites for Using Route Maps with MPLS VPNs
•Information About Route Maps in MPLS VPNs
•How to Configure Route Maps in an MPLS VPN
•Configuration Examples for Route Maps in MPLS VPNs
•Additional References
•Feature Information for Route Maps in MPLS VPNs
Restrictions for Using Route Maps with MPLS VPNs
You can use route maps with MPLS VPN Inter-AS with Autonomous System Boundary Routers (ASBRs) exchanging IPv4 routes with MPLS labels. You cannot use route maps with MPLS VPN Inter-AS with ASBRs exchanging VPN-IPv4 addresses.
Prerequisites for Using Route Maps with MPLS VPNs
Before you configure and apply route maps, you need to create an access control list (ACL) and specify the routes that the router should distribute with MPLS labels.
Information About Route Maps in MPLS VPNs
When routers are configured to distribute routes with MPLS labels, all the routes are encoded with the multiprotocol extensions and contain MPLS labels. You can use a route map to control the distribution of MPLS labels between routers.
Route maps enable you to specify which routes are distributed with MPLS labels. Route maps also enable you to specify which routes with MPLS labels a router receives and adds to its BGP table. Route maps enable you to specify the following:
•For a router distributing MPLS labels, you can specify which routes are distributed with an MPLS label.
•For a router receiving MPLS labels, you can specify which routes are accepted and installed in the BGP table.
Route maps work with ACLs. You enter the routes into an ACL and then specify the ACL when you configure the route map. You can configure a router to accept only routes that are specified in the route map. The router checks the routes listed in the BGP update message against the list of routes in the specified ACL. If a route in the BGP update message matches a route in the ACL, the route is accepted and added to the BGP table.
How to Configure Route Maps in an MPLS VPN
Perform the following tasks to enable routers to send MPLS labels with the routes specified in the route maps:
•Configuring a Route Map for Incoming Routes (optional)
•Configuring a Route Map for Outgoing Routes (optional)
•Applying the Route Maps to the MPLS VPN Edge Routers (optional)
Configuring a Route Map for Incoming Routes
Perform this task to create a route map to filter arriving routes. You create an ACL and specify the routes that the router should accept and add to the BGP table.
SUMMARY STEPS
1. enable
2. configure terminal
3. router bgp as-number
4. route-map
map-name [permit | deny] sequence-number
5. match ip address {access-list-number [access-list-number... | access-list-name...] | access-list-name [access-list-number...| access-list-name] | prefix-list prefix-list-name [prefix-list-name...]}
6. match mpls-label
7. exit
DETAILED STEPS
|
|
|
Step 1 |
enable
Router> enable |
Enables privileged EXEC mode. •Enter your password if prompted. |
Step 2 |
configure terminal
Router# configure terminal |
Enters global configuration mode. |
Step 3 |
router bgp as-number
Router(config)# router bgp 100 |
Configures a BGP routing process and enters router configuration mode. •The as-number argument indicates the number of an autonomous system that identifies the router to other BGP routers and tags the routing information passed along. Valid numbers are from 0 to 65535. Private autonomous system numbers that can be used in internal networks range from 64512 to 65535. |
Step 4 |
route-map map-name [permit | deny] sequence-number
Router(config-router)# route-map csc-mpls-routes-in permit |
Enters route map configuration mode and creates a route map with the name you specify. •The map-name argument identifies the name of the route map. •The permit keyword allows the actions to happen if all conditions are met. •A deny keyword prevents any actions from happening if all conditions are met. •The sequence-number argument allows you to prioritize route maps. If you have multiple route maps and want to prioritize them, assign each one a number. The route map with the lowest number is implemented first, followed by the route map with the second lowest number, and so on. |
Step 5 |
match ip address {access-list-number [access-list-number... | access-list-name...] | access-list-name [access-list-number...| access-list-name] | prefix-list prefix-list-name [prefix-list-name...]}
Router(config-route-map)# match ip address acl-in |
Distributes any routes that have a destination network number address that is permitted by a standard access list, an extended access list, or a prefix list, or performs policy routing on packets. •The access-list-number... argument is a number of a standard or extended access list. It can be an integer from 1 to 199. The ellipsis indicates that multiple values can be entered. •The access-list-name... argument is a name of a standard or extended access list. It can be an integer from 1 to 199. The ellipsis indicates that multiple values can be entered. •The prefix-list keyword distributes routes based on a prefix list. •The prefix-list-name... argument is a name of a specific prefix list. The ellipsis indicates that multiple values can be entered. |
Step 6 |
match mpls-label
Router(config-route-map)# match mpls-label |
Redistributes routes that include MPLS labels if the routes meet the conditions specified in the route map. |
Step 7 |
exit
Router(config-route-map)# exit |
Exits route map configuration mode and returns to global configuration mode. |
Configuring a Route Map for Outgoing Routes
This configuration is optional.
Perform this task to create a route map to filter departing routes. You create an access list and specify the routes that the router should distribute with MPLS labels.
SUMMARY STEPS
1. enable
2. configure terminal
3. router bgp as-number
4. route-map
map-name [permit | deny] sequence-number
5. match ip address {access-list-number [access-list-number... | access-list-name...] | access-list-name [access-list-number...| access-list-name] | prefix-list prefix-list-name [prefix-list-name...]}
6. set mpls-label
7. exit
DETAILED STEPS
|
|
|
Step 1 |
enable
Router> enable |
Enables privileged EXEC mode. •Enter your password if prompted. |
Step 2 |
configure terminal
Router# configure terminal |
Enters global configuration mode. |
Step 3 |
router bgp as-number
Router(config)# router bgp 100 |
Configures a BGP routing process and enters router configuration mode. •The as-number argument indicates the number of an autonomous system that identifies the router to other BGP routers and tags the routing information passed along. Valid numbers are from 0 to 65535. Private autonomous system numbers that can be used in internal networks range from 64512 to 65535. |
Step 4 |
route-map map-name [permit | deny] sequence-number
Router(config-router)# route-map csc-mpls-routes-out permit |
Enters route map configuration mode and creates a route map with the name you specify. •The map-name argument identifies the name of the route map. •The permit keyword allows the actions to happen if all conditions are met. •A deny keyword prevents any actions from happening if all conditions are met. •The sequence-number argument allows you to prioritize route maps. If you have multiple route maps and want to prioritize them, assign each one a number. The route map with the lowest number is implemented first, followed by the route map with the second lowest number, and so on. |
Step 5 |
match ip address {access-list-number [access-list-number... | access-list-name...] | access-list-name [access-list-number...| access-list-name] | prefix-list prefix-list-name [prefix-list-name...]}
Router(config-route-map)# match ip address acl-out |
Distributes any routes that have a destination network number address that is permitted by a standard access list, an extended access list, or a prefix list, or performs policy routing on packets. •The access-list-number... argument is a number of a standard or extended access list. It can be an integer from 1 to 199. The ellipsis indicates that multiple values can be entered. •The access-list-name... argument is a name of a standard or extended access list. It can be an integer from 1 to 199. The ellipsis indicates that multiple values can be entered. •The prefix-list keyword distributes routes based on a prefix list. •The prefix-list-name... argument is a name of a specific prefix list. The ellipsis indicates that multiple values can be entered. |
Step 6 |
set mpls-label
Router(config-route-map)# set mpls-label |
Enables a route to be distributed with an MPLS label if the route matches the conditions specified in the route map. |
Step 7 |
exit
Router(config-route-map)# exit |
Exits route map configuration mode and returns to global configuration mode. |
Applying the Route Maps to the MPLS VPN Edge Routers
This configuration is optional.
Perform this task to enable the edge routers to use the route maps.
SUMMARY STEPS
1. enable
2. configure terminal
3. router bgp as-number
4. address-family ipv4 [multicast | unicast | vrf vrf-name}
5. neighbor
ip-address route-map route-map-name in
6. neighbor
ip-address route-map route-map-name out
7. neighbor
ip-address send-label
8. exit-address-family
9. end
DETAILED STEPS
|
|
|
Step 1 |
enable
Router> enable |
Enables privileged EXEC mode. •Enter your password if prompted. |
Step 2 |
configure terminal
Router# configure terminal |
Enters global configuration mode. |
Step 3 |
router bgp as-number
Router(config)# router bgp 100 |
Configures a BGP routing process and enters router configuration mode. •The as-number argument indicates the number of an autonomous system that identifies the router to other BGP routers and tags the routing information passed along. Valid numbers are from 0 to 65535. Private autonomous system numbers that can be used in internal networks range from 64512 to 65535. |
Step 4 |
address-family ipv4 [multicast | unicast | vrf vrf-name]
Router(config-router)# address-family ipv4 vrf vpn1 |
Specifies the IPv4 address family type and enters address family configuration mode. •The multicast keyword specifies IPv4 multicast address prefixes. •The unicast keyword specifies IPv4 unicast address prefixes. •The vrf vrf-name keyword and argument specify the name of the VRF to associate with subsequent IPv4 address family configuration mode commands. |
Step 5 |
neighbor ip-address route-map map-name in
Router(config-router-af)# neighbor pp.0.0.1 route-map csc-mpls-routes-in in |
Applies a route map to incoming routes. •The ip-address argument specifies the router to which the route map is to be applied. •The map-name argument specifies the name of the route map. •The in keyword applies the route map to incoming routes. |
Step 6 |
neighbor ip-address route-map map-name out
Router(config-router-af)# neighbor pp.0.0.1 route-map csc-mpls-route-out out |
Applies a route map to outgoing routes. •The ip-address argument specifies the router to which the route map is to be applied. •The map-name argument specifies the name of the route map. •The out keyword applies the route map to outgoing routes. |
Step 7 |
neighbor ip-address send-label
Router(config-router-af)# neighbor pp.0.0.1 send-label |
Enables a BGP router to send MPLS labels with BGP routes to a neighboring BGP router. •The ip-address argument specifies the IP address of the neighboring router. |
Step 8 |
exit-address-family
Router(config-router-af)# exit-address-family |
Exits from address family configuration mode. |
Step 9 |
Router(config-router)# end
|
(Optional) Exits to privileged EXEC mode. |
Troubleshooting Tips
You can enter a show route-map map-name command to verify that the route map is applied to the PE routers.
Note After you make any changes to a route map, you need to reset the BGP connection for the changes to take effect.
Configuration Examples for Route Maps in MPLS VPNs
This section includes the following MPLS VPN route map examples:
•Using a Route Map in an MPLS VPN Inter-AS Network: Example
•Using a Route Map in an MPLS VPN CSC Network: Example
Using a Route Map in an MPLS VPN Inter-AS Network: Example
In this example, a route map is applied to an autonomous system border router (ASBR) that exchanges IPv4 routes and MPLS labels with another ASBR.
•A route map called OUT specifies that the ASBR should distribute the PE1 route (ee.ee) with labels and the RR1 route (aa.aa) without labels.
•A route map called IN specifies that the ASBR should accept the PE2 route (ff.ff) with labels and the RR2 route (bb.bb) without labels.
ip address ww.ww.ww.ww 255.255.255.255
ip address hh.0.0.2 255.0.0.0
ip address dd.0.0.1 255.0.0.0
auto-cost reference-bandwidth 1000
redistribute connected subnets
passive-interface Ethernet0/2
network ww.ww.ww.ww 0.0.0.0 area 100
network dd.0.0.0 0.255.255.255 area 100
neighbor aa.aa.aa.aa remote-as 100
neighbor aa.aa.aa.aa update-source Loopback0
neighbor hh.0.0.1 remote-as 200
address-family ipv4 ! Redistributing IGP into BGP
redistribute ospf 10 ! so that PE1 & RR1 loopbacks
neighbor aa.aa.aa.aa activate ! get into the BGP table
neighbor aa.aa.aa.aa send-label
neighbor hh.0.0.1 activate
neighbor hh.0.0.1 advertisement-interval 5
neighbor hh.0.0.1 send-label
neighbor hh.0.0.1 route-map IN in ! accepting routes in route map IN.
neighbor hh.0.0.1 route-map OUT out ! distributing routes in route map OUT.
neighbor kk.0.0.1 activate
neighbor kk.0.0.1 advertisement-interval 5
neighbor kk.0.0.1 send-label
neighbor kk.0.0.1 route-map IN in ! accepting routes in route map IN.
neighbor kk.0.0.1 route-map OUT out ! distributing routes in route map OUT.
ip default-gateway 3.3.0.1
access-list 1 permit ee.ee.ee.ee log !Setting up the access lists
access-list 2 permit ff.ff.ff.ff log
access-list 3 permit aa.aa.aa.aa log
access-list 4 permit bb.bb.bb.bb log
route-map IN permit 10 !Setting up the route maps
Using a Route Map in an MPLS VPN CSC Network: Example
The following example creates two route maps, which are named:
•IN for incoming routes
•OUT for outgoing routes
The route maps specify the following:
•If an IP address in an incoming BGP update message matches an IP address in access list 99, the route is added to the BGP table.
•If an IP address in an outbound BGP update message matches an IP address in access list 88, the router distributes that route.
The route maps are applied to the CSC-PE router with the address qq.0.0.1.
address-family ipv4 vrf vpn2
neighbor qq.0.0.1 remote-as 200
neighbor qq.0.0.1 activate
neighbor qq.0.0.1 as-override
neighbor qq.0.0.1 advertisement-interval 5
neighbor qq.0.0.1 route-map IN in
neighbor qq.0.0.1 route-map OUT out
neighbor qq.0.0.1 send-label
access-list 88 permit rr.rr.rr.rr
access-list 88 permit ss.ss.ss.ss
access-list 88 permit tt.tt.tt.tt
access-list 99 permit uu.uu.uu.uu
access-list 99 permit vv.vv.vv.vv
access-list 99 permit ww.ww.ww.ww
Additional References
Related Documents
Standards
|
|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature. |
— |
MIBs
|
|
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 IOS releases, and feature sets, use Cisco MIB Locator found at the following URL: http://www.cisco.com/go/mibs |
RFCs
Technical Assistance
|
|
The Cisco Technical Support website contains thousands of 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. |
http://www.cisco.com/techsupport |
Feature Information for Route Maps in MPLS VPNs
Table 1 lists the features in this module and provides links to specific configuration information.
Not all commands may be available in your Cisco IOS software release. For details on when support for specific commands was introduced, see the command reference documents.
Cisco IOS software images are specific to a Cisco IOS software release, a feature set, and a platform. 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.
Note Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS software release train also support that feature.
Table 1 Feature Information for Route Maps in MPLS VPNs
|
|
Feature Configuration Information
|
This feature was included as part of the following features: •MPLS VPN Inter-Autonomous Systems - IPv4 BGP Label Distribution •MPLS VPN Carrier Supporting Carrier with IPv4 BGP Label Distribution |
12.0(21)ST 12.0(22)S 12.0(23)S 12.2(13)T 12.0(24)S 12.2(14)S 12.0(27)S 12.0(29)S |
Route maps enable you to specify which routes are distributed with MPLS labels. Route maps also enable you to specify which routes with MPLS labels a router receives and adds to its BGP table. The following sections provide information about this feature: •Information About Route Maps in MPLS VPNs •How to Configure Route Maps in an MPLS VPN |
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.
© 2007 Cisco Systems, Inc. All rights reserved.