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.
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
You can specify more than one value in each match entry of a route map by using any of the following match commands:
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.
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
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.
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
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.
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:
- host1(config)#route-map tagtest
- host1(config-route-map)#match tag 30
- host1(config)#router bgp 405
- host1(config-router)#redistribute access route-map
tagtest
- host1(config-router)#redistribute access-internal
route-map tagtest
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 Configuring IPv4 Multicast or chapter Configuring IPv6 Multicast in JUNOSe Multicast Routing Configuration Guide.
match as-path
- host1(config-route-map)#match as-path pathlist5
match community
- host1(config-route-map)#match community comm5
match distance
- host1(config-route-map)#match distance 25
match extcommunity
- host1(config-route-map)#match extcommunity
topeka10
match ip address
- host1(config-route-map)#match ip address prefix-tree
boston
match ip next-hop
- host1(config-route-map)#match ip next-hop
5 acl_192_54_24_1
match ipv6 address
- host1(config-route-map)#match ipv6 address
prefix-list boston
match ipv6 next-hop
- host1(config-route-map)#match ipv6 next-hop
prefix-list next1
match ipv6 route-source
- host1(config-route-map)#match ipv6 route-source
prefix-list source
match level
- host1(config-route-map)#match level level-1
match metric
- host1(config-route-map)#match metric 10
match metric-type
- host1(config-route-map)#match metric-type
external
match policy-list
- host1(config-route-map)#match policy-list
list1
match route-type
- host1(config-route-map)#match route-type level-1
match-set summary prefix-tree
- host1(config-route-map)#match-set summary
prefix-tree boston
match tag
- host1(config)#route-map 1
- host1(config-route-map)#match tag 25
route-map
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match ip address list1
- host1(config-route-map)#set metric-type internal
set as-path prepend
- host1(config-route-map)#set as-path prepend
list list10
set automatic-tag
- host1(config-route-map)#set automatic-tag
set comm-list delete
- host1(config)#ip community-list 1 permit 231:10
- host1(config)#ip community-list 1 permit 231:20
- host1(config)#router bgp 45
- host1(config-router)#neighbor 10.6.2.5 remote-as
5
- host1(config-router)#neighbor 10.6.2.5 route-map
indelete in
- host1(config-router)#route-map indelete permit
10
- host1(config-route-map)#set comm-list 1 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.
- host1(config-route-map)#set comm-list 1 delete
set community
- host1(config-route-map)#set community no-advertise
set dampening
- host1(config-route-map)#set dampening 5 1000
1500 45 15
set distance
- host1(config-route-map)#set distance 5
set extcommunity
- host1(config-route-map)#set extcommunity rt
10.10.10.2:325
set ip next-hop
- host1(config-route-map)#set ip next-hop 192.56.32.1
set ipv6 next-hop
- host1(config-route-map)#set ipv6 next-hop
1::1
set level
- host1(config-route-map)#set level level-2
set local-preference
- host1(config-route-map)#set local-preference
200
set metric
- host1(config-route-map)#set metric 10
- host1(config-route-map)#set metric -25
set metric-type
- host1(config-route-map)#set metric-type internal
set origin
- host1(config-route-map)#set origin egp
set route-class
- host1(config-route-map)#set route-class 50
set route-type
- host1(config-route-map)#set route-type internal
set tag
- host1(config-route-map)#set tag 23
set weight
- host1(config-route-map)#set weight 200