[Contents] [Prev] [Next] [Index] [Report an Error] [No Frames]


Route Maps

You can use route maps to control and modify routing information and to define conditions for redistributing routes between routing domains. You can apply route maps to inbound, outbound, or redistribution routes. A route map consists of match clauses and set clauses.

Match clauses specify the attribute values that determine whether a route matches the route map. A route that has the same attribute values passes the match condition. Routes that pass all the match conditions match the route map. You issue match commands to define the match conditions for a route map. You can specify the match conditions in any order. If you do not specify any match conditions in a route map, that route map matches all routes.

Set clauses define how the attributes are modified for matching routes. The set conditions apply only to routes that pass all the match conditions (or a route map with no match conditions). When a route passes all the match conditions, the router software applies all set conditions. You issue set commands to define the set conditions for a route map.

You assign a unique string called the map tag to identify each route map. You can have multiple instances of a route map, where each instance consists of a different group of clauses. Each instance is identified by a sequence number. When you apply a route map, the routing protocol evaluates routes against the instance of the route map with the lowest sequence number. If the routes pass all the match conditions specified in the lowest-numbered instance, and if all set commands are successfully applied, no other instance of the route map is considered. However, any routes that do not pass all the match conditions are evaluated against the next instance of the route map. For example, suppose you create two instances of route map boston5, one with sequence number 10 and one with sequence number 25. When you apply boston5, routes are evaluated first against instance 10; any that do not match are evaluated against instance 25.

When you apply a route map, you specify the permit or deny keyword:

A route map must have at least one match clause or one set clause. If you have no match clauses, all routes match the route map, and the set conditions apply to all routes. If you have no set clauses, no action is taken other than that specified by the permit or deny keyword.

Route Map Configuration Example

Consider the network structure shown in Figure 1. Suppose you do not want router Boston to receive any routes that originate in or pass through router Chicago.


Figure 1: Applying Route Maps to Routes

You can use a route map to filter routes based on the autonomous system (AS) path to accomplish this goal. Use the following commands to configure router NY:

host1(config)#router bgp 293
host1(config-router)#network 192.168.5.0 mask 255.255.255.0
host1(config-router)#neighbor 10.5.5.2 remote-as 32
host1(config-router)#neighbor 10.2.2.2 remote-as 873
host1(config-router)#neighbor 10.2.2.4 remote-as 17
host1(config-router)#neighbor 10.2.2.4 route-map block1 out
host1(config-router)#exit
host1(config)#ip as-path access-list boston deny _32_
host1(config)#route-map block1 deny 1
host1(config-route-map)#match as-path boston

Multiple Values in a Match Entry

You can specify more than one value in each match entry of a route map by using any of the following match commands:


match as-path

match ipv6 next-hop

match community

match ipv6 route-source

match distance

match level

match extcommunity-list

match metric

match ip address

match policy-list

match ip next-hop

match route-type

match ipv6 address

match tag

A clause with multiple values matches a route that has any of the values; that is, the multiple values are logical ORed.

host1(config-route-map)#match ip address lisbon madrid
host1(config-route-map)#match as-path 10 20 30

You can also issue successive match commands to add new values to a route map entry for any of the commands listed above.

host1(config-route-map)#match ip address boston 
host1(config-route-map)#match ip address newyork 

This method is equivalent to issuing the following single command:

host1(config-route-map)#match ip address boston newyork

You cannot specify multiple values for the match metric-type command, because it has only two acceptable values, which are mutually exclusive. Specifying both values has the same effect as not specifying a metric type at all; specifying the same value more than once has no meaning.

Negating Match Clauses

If you specify a value when you negate a match command configured in a route map, only that value for the match entry is deleted. The routing software deletes the entire match entry only if the entry contains no other values. In some earlier releases, any value specified with a no match command was ignored, and the entire match entry was deleted. This change applies to all match commands configured in a route map.

For example, consider the following match entry to route map miami:

host1(config)#ip community-list corporate5 permit 32 463 21
host1(config)#ip community-list dade2 permit 41 53 22
host1(config)#route-map miami permit 1
host1(config-route-map)#match community corporate5 dade2
host1(config-route-map)#exit
host1(config)#exit
host1#show route-map
route-map miami, permit, sequence 10
  Match clauses:
    match community corporate5 dade2

In earlier releases, issuing a command like the following to remove a community (see Community Lists) not specified in the entry deleted the whole entry, but now nothing happens:

host1(config-route-map)#no match community southbeach
host1(config-route-map)#exit
host1(config)#exit
host1#show route-map
route-map miami, permit, sequence 10
  Match clauses:
    match community corporate5 dade2

If you instead issue the following commands, the specified value is deleted:

host1(config-route-map)#no match community dade2
host1(config-route-map)#exit
host1(config)#exit
host1#show route-map
route-map miami, permit, sequence 10
  Match clauses:
    match community corporate5

Issue either of the following commands to delete the entire match community entry:

host1(config-route-map)#no match community 
host1(config-route-map)#no match community corporate5 dade2

Matching a Community List Exactly

You can use the exact-match keyword for the match community command to specify that a match exists only for the exact community numbers specified in the community list. The exact-match keyword applies only to a standard community list—that is, one not specified by a regular expression. You cannot use the exact-match keyword with a community list that is specified by a regular expression.

Consider the following example:

host1(config)#ip community-list 1 permit 100 200 300
host1(config)#exit
host1#show ip community-list
Community standard list 1
     permit 0:100 0:200 0:300
host1(config)#route-map example1 permit 10
host1(config-route-map)#match community 1 exact-match
host1(config)#exit
host1#show route-map example1
route-map example, permit, sequence 10
  Match clauses:
    community (community-list filter): 1 exact-match

The route map example1 permits a route only if the route contains community 100 and community 200 and community 300 and no additional communities.

If you do not specify the exact-match option, the route map also permits a match on a route that contains additional communities. For example, a route that contains communities 100, 200, 300, 400, and 450 matches.

Removing Community Lists from a Route Map

You can use the set comm-list delete command to remove the specified community list from routes matching the route map, provided that you created the community list with a single community number per list entry. For example, you cannot remove the community lists 231:10 and 231:20 with the set comm-list delete command if you created them with the following command:

host1(config)#ip community list 1 permit 231:10 231:20

You can, however, remove the lists with the set comm-list delete command if you created them separately with the following commands:

host1(config)#ip community list 1 permit 231:10 
host1(config)#ip community list 1 permit 231:20

Matching a Policy List

You can use the match policy-list command to reference a policy list within the route map. Policy lists are like route maps, but they contain only match clauses and no set clauses. You can create a policy list to contain a group of match clauses once, referencing the list in any number of route maps and avoiding the task of having to reenter the match clauses separately into each route map.

For more information about creating IP policy lists, see Match Policy Lists.

Redistributing Access Routes

Access-internal routes, such as DHCP and AAA/PPP host routes, are host routes to directly connected clients. Access routes, also known as AAA framed routes, are sourced by AAA.

The following example shows how you might redistribute access-internal routes and access routes by matching on a tag:

  1. Configure route map tagtest to match tag 30.
  2. host1(config)#route-map tagtest
    
    host1(config-route-map)#match tag 30 
    
    
    
  3. Configure redistribution into BGP of the access-internal routes and access routes with route map tagtest.
  4. host1(config)#router bgp 405
    
    host1(config-router)#redistribute access route-map tagtest
    
    host1(config-router)#redistribute access-internal route-map tagtest
    

Setting Multicast Bandwidths

You can use the set admission-bandwidth command to set a multicast bandwidth for admission control. Admission control is performed for the join and mapped interface when the OIF is added to the mroute.

You can use the set qos-bandwidth command to set a multicast bandwidth for QoS control. The QoS adjustment is made to the join interface when the OIF is added to the mroute.

NOTE: Both the admission bandwidth and QoS bandwidth are a constant bit rate.


For more information about multicast admission control or QoS adjustment, see JUNOSe Multicast Routing Configuration Guide, Chapter 5, Configuring IPv4 Multicast or JUNOSe Multicast Routing Configuration Guide, Chapter 10, Configuring IPv6 Multicast.

match as-path

match community

match distance

match extcommunity

match ip address

match ip next-hop

match ipv6 address

match ipv6 next-hop

match ipv6 route-source

match level

match metric

match metric-type

match policy-list

match route-type

match-set summary prefix-tree

match tag

route-map

set as-path prepend

set automatic-tag

set comm-list delete

Router host1 receives the same route from 10.6.2.5 and applies the indelete route map. BGP compares each list entry with the community attribute. A match is found for the list entry 231:10, and this community is deleted from the community attribute. Similarly, a match is found for the list entry of 231:20, and this community is deleted from the community attribute.

set community

set dampening

set distance

set extcommunity

set ip next-hop

set ipv6 next-hop

set level

set local-preference

set metric

set metric-type

set origin

set route-class

set route-type

set tag

set weight


[Contents] [Prev] [Next] [Index] [Report an Error] [No Frames]