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.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and 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.

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.

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

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

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

router bgp as-number

Example:


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

Example:


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....]]

Example:


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

Example:


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

Example:


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

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

router bgp as-number

Example:


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

Example:


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....]]

Example:


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

Example:


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

Example:


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 map-name in
  6. neighbor ip-address route-map map-name out
  7. neighbor ip-address send-label
  8. exit-address-family
  9. end

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

router bgp as-number

Example:


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]

Example:


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

Example:


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

Example:


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

Example:


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

Example:


Router(config-router-af)# exit-address-family

Exits from address family configuration mode.

Step 9

end

Example:


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

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 subnet-zero
mpls label protocol tdp
!
interface Loopback0
 ip address ww.ww.ww.ww 255.255.255.255
 no ip directed-broadcast
 no ip route-cache
 no ip mroute-cache
!
interface Ethernet0/2
 ip address hh.0.0.2 255.0.0.0
 no ip directed-broadcast
 no ip mroute-cache
!
interface Ethernet0/3
 ip address dd.0.0.1 255.0.0.0
 no ip directed-broadcast
 no ip mroute-cache
 mpls label protocol ldp
 tag-switching ip
!
router ospf 10
 log-adjacency-changes
 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
 
router bgp 100
 bgp log-neighbor-changes
 timers bgp 10 30
 neighbor aa.aa.aa.aa remote-as 100
 neighbor aa.aa.aa.aa update-source Loopback0
 neighbor hh.0.0.1 remote-as 200
 no auto-summary
 !
!
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.
 no auto-summary
 no synchronization
 exit-address-family
!
ip default-gateway 3.3.0.1
ip classless
!
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
 match ip address 2
 match mpls-label
!
route-map IN permit 11
 match ip address 4
!
route-map OUT permit 12
 match ip address 3
!
route-map OUT permit 13
 match ip address 1
 set mpls-label
!
end

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
!
route-map IN permit 1
 match ip address 99
!
route-map OUT permit 1
 match ip address 88
 set mpls-label
!

Additional References

Related Documents

Related Topic

Document Title

Basic MPLS VPNs

Configuring MPLS Layer 3 VPNs

MPLS VPN Carrier Supporting Carrier

  • MPLS VPN Carrier Supporting Carrier Using LDP and an IGP

  • MPLS VPN Carrier Supporting Carrier with BGP

MPLS VPN InterAutonomous Systems

  • MPLS VPN Inter-AS with ASBRs Exchanging IPv4 Routes and MPLS Labels

  • MPLS VPN Inter-AS with ASBRs Exchanging VPN-IPv4 Addresses

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:

http://www.cisco.com/go/mibs

RFCs

RFC

Title

RFC 2547

BGP/MPLS VPNs

Technical Assistance

Description

Link

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.

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.

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.

http://www.cisco.com/techsupport

Feature Information for Route Maps in MPLS VPNs

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 Route Maps in MPLS VPNs

Feature Name

Releases

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.