Lesson Overview
Route maps are powerful policy-based configuration tools used in Cisco enterprise networks to control routing information, modify route attributes, influence path selection, and implement policy-based routing.
In large enterprise networks, routing protocols dynamically exchange routing information. However, network administrators may need more control over which routes are advertised, accepted, redistributed, or preferred.
For example, an enterprise network may require the following:
Redistribute only selected static routes into OSPF.
Assign specific metrics to routes redistributed between routing protocols.
Modify BGP attributes to influence route selection.
Control routing information using prefix lists and ACLs.
Direct selected application traffic through a preferred WAN connection.
Prevent unauthorized or unnecessary routes from being redistributed.
Cisco route maps provide a flexible mechanism for implementing these routing policies. A route map consists of ordered statements that evaluate matching conditions and perform actions based on the policy configuration. Route maps are commonly used with BGP, OSPF, EIGRP, route redistribution, and Policy-Based Routing (PBR).
This lesson explains route-map architecture, syntax, match and set conditions, permit and deny behavior, route filtering, redistribution, BGP policy control, PBR, verification, troubleshooting, and real-world implementation scenarios.
Learning Objectives
After completing this lesson, you will be able to:
Explain the purpose of Cisco route maps.
Understand route-map architecture and processing logic.
Configure route-map permit and deny statements.
Explain route-map sequence numbers.
Use
matchandsetcommands.Understand the relationship between ACLs, prefix lists, and route maps.
Configure route maps for route redistribution.
Filter selected routes between routing protocols.
Modify routing metrics using route maps.
Implement BGP routing policies using route maps.
Verify route-map configurations using Cisco IOS/IOS XE commands.
Troubleshoot route-map and route redistribution problems.
1. What Is a Route Map?
A route map is an ordered policy structure used by Cisco IOS and IOS XE to match specified conditions and apply actions to matching routes or packets, depending on the feature using the route map.
Route maps allow administrators to define policies using two main elements:
match– Specifies the conditions that must be satisfied.set– Specifies attributes or forwarding actions to apply when a permitted entry matches.
Basic Route-Map Syntax
|
route-map ROUTE_MAP_NAME permit 10 match CONDITION set ACTION |
Each route-map statement is identified by a name, an action (permit or deny), and a sequence number. Multiple sequences with the same route-map name form one policy.
1.1 Why Are Route Maps Important?
Route maps provide advanced control over routing behavior.
Common Use Cases
Use Case | Purpose |
|---|---|
Route Redistribution | Select routes exchanged between protocols |
Route Filtering | Control route acceptance or advertisement |
Metric Manipulation | Change metrics assigned during redistribution |
BGP Policy | Modify attributes such as local preference and MED |
Policy-Based Routing | Influence forwarding based on packet attributes |
Route Tagging | Mark redistributed routes |
Routing Optimization | Apply business-driven routing preferences |
Loop Prevention | Use route tags and filters in redistribution designs |
Example
An organization has OSPF and EIGRP routing domains.
Only two specific networks should be redistributed from EIGRP into OSPF.
A route map can select those prefixes while excluding other EIGRP routes.
2. Route-Map Architecture
2.1 How Route Maps Work
Route maps consist of ordered entries.
Each entry has:
A sequence number.
A permit or deny action.
Optional match conditions.
Optional set actions.
Entries are evaluated in sequence-number order.
Route-Map Processing Topology
Sequence numbers control the order in which route-map statements are evaluated. Lower sequence numbers are processed first. Common practice is to number entries in increments of 10 so new entries can be inserted later.
|
route-map POLICY permit 10 match ip address prefix-list PL-PREFERRED set local-preference 200 ! route-map POLICY permit 20 match ip address prefix-list PL-BACKUP set local-preference 150 ! route-map POLICY permit 100 |
Interpretation
Sequence 10 is checked first.
If sequence 10 matches, its set actions are applied and route-map processing normally stops.
If sequence 10 does not match, sequence 20 is evaluated.
Sequence 100 is a catch-all permit with no match statement.
If no sequence matches, the route map has an implicit deny for route filtering/policy applications.
3.1 Permit vs Deny
|
Route-Map Action |
Meaning |
|
permit |
If the match conditions succeed, allow the item to continue through the feature and apply any set actions. |
|
deny |
If the match conditions succeed, reject the item for that route-map application. Set statements are not used to permit the denied route. |
|
implicit deny |
If no sequence matches, the item is denied in most route-policy contexts. |
3.2 Implicit Deny
If no route-map entry matches, processing normally reaches an implicit deny.
Example
|
route-map FILTER_ROUTES permit 10 match ip address prefix-list PL-PREFERRED |
Only matching routes are permitted for redistribution or BGP filtering.
Other routes are implicitly denied.
Permit Everything Else
route-map FILTER_ROUTES permit 20 |
An entry without match conditions matches all remaining objects in common route-map applications.
Warning: A final permit-all entry can unintentionally redistribute or advertise routes that were meant to remain excluded.
4. Match and Set Commands
4.1 Match Statements
A match statement defines what the route-map sequence is looking for. Match criteria vary by feature and software platform. For routing policy, the most common criteria are prefix lists, ACLs, route tags, communities, interfaces, and route attributes.
Common Match Examples
|
match ip address prefix-list PL-INTERNAL match ip address ACL-ROUTES match tag 110 match community 10 match interface GigabitEthernet0/0 |
Multiple Match Statements
Multiple match statements can make the policy more specific. Exact behavior depends on the match type and feature, so students should verify the relevant IOS XE command reference. As a design principle, keep route-map sequences simple enough that the intended match is easy to verify.
4.2 Set Statements
A set statement changes an attribute or action after the route matches a permit sequence. The available set commands depend on where the route map is applied.
Common Routing Set Actions
|
Set Statement |
Typical Use |
|
set local-preference 200 |
Prefer an inbound BGP path inside the local AS. |
|
set metric 50 |
Change a route metric or BGP MED where supported by the feature. |
|
set weight 500 |
Apply Cisco BGP weight locally on the router. |
|
set community 65001:100 additive |
Add a BGP community without replacing existing communities. |
|
set tag 110 |
Attach a route tag during redistribution. |
|
set ip next-hop 10.1.1.1 |
Policy-based routing: change forwarding next hop for matched packets. |
Example
|
route-map RM-ISP-A-IN permit 10 match ip address prefix-list PL-DEFAULT set local-preference 200 |
This sequence matches the default route and assigns local preference 200 when the route map is used as an inbound BGP policy.
5. Route-Map Processing Logic
A route or packet enters a feature that references the route map.
The device evaluates the lowest route-map sequence first.
If the match conditions fail, processing moves to the next sequence.
If the match conditions succeed on a permit sequence, the set actions are applied and the item is permitted for the calling feature.
If the match conditions succeed on a deny sequence, the item is denied for the calling feature.
If no sequence matches, the implicit deny applies in route-filtering contexts.
5.1 Important Processing Examples
|
Sequence |
Match Result |
Action |
|
10 permit |
No match |
Continue to next sequence |
|
20 deny |
Match |
Deny; stop processing |
|
30 permit |
Match |
Permit, apply set actions; stop processing |
|
No sequence matches |
— |
Implicit deny |
5.2 Catch-All Permit
route-map POLICY permit 100
A route-map sequence with no match statement generally matches everything that reaches that sequence. This is commonly used as an explicit catch-all permit when the policy should modify/filter only selected routes but allow the rest.
6. Enterprise Route-Map Reference Topology
The following topology is used throughout the configuration and verification examples. R2 is the enterprise edge router in AS 65001. It learns external routes from ISP-A and ISP-B and applies route maps to control path preference, filtering, and attributes.
6.1 Training Addressing and Roles
|
Device / Link |
Role / Example |
|
SW1 / LAN |
10.10.10.0/24 enterprise LAN |
|
R1 |
Core router; OSPF Area 0 |
|
R2 |
Enterprise edge; BGP AS 65001; route-map policy point |
|
ISP-A |
eBGP peer AS 65002; preferred inbound path |
|
ISP-B |
eBGP peer AS 65003; backup inbound path |
|
R2 policy |
Prefix filtering, local preference, MED/community, tagging/redistribution |
7. Prefix Lists with Route Maps
Prefix lists are usually the preferred tool for matching IP routes because they are purpose-built for route prefixes and support exact prefix length control with ge and le.
7.1 Prefix-List Examples
|
ip prefix-list PL-DEFAULT seq 5 permit 0.0.0.0/0 ip prefix-list PL-INTERNAL seq 10 permit 10.10.10.0/24 ip prefix-list PL-SUMMARY seq 10 permit 10.0.0.0/8 le 24 |
7.2 Use Prefix List in a Route Map
|
route-map RM-ISP-A-IN permit 10 match ip address prefix-list PL-DEFAULT set local-preference 200 ! route-map RM-ISP-A-IN permit 100 |
Apply to BGP Neighbor
|
router bgp 65001 neighbor 203.0.113.2 remote-as 65002 neighbor 203.0.113.2 route-map RM-ISP-A-IN in |
7.3 Prefix-List Verification
|
R2# show ip prefix-list PL-DEFAULT ip prefix-list PL-DEFAULT: 1 entries seq 5 permit 0.0.0.0/0 (hit count: 1) |
8. ACLs with Route Maps
Standard or extended ACLs can also be referenced by route maps. When used for route matching, the ACL is not necessarily filtering packets; it is classifying routes for the feature that called the route map. Prefix lists are generally clearer for pure route-prefix policy, but ACL matching remains common in legacy and mixed configurations.
8.1 Standard ACL Match Example
|
ip access-list standard ACL-ROUTES permit 10.10.10.0 0.0.0.255 permit 10.20.20.0 0.0.0.255 ! route-map RM-ACL-FILTER permit 10 match ip address ACL-ROUTES route-map RM-ACL-FILTER deny 100 |
Verification
|
R2# show access-lists ACL-ROUTES Standard IP access list ACL-ROUTES 10 permit 10.10.10.0, wildcard bits 0.0.0.255 (4 matches) 20 permit 10.20.20.0, wildcard bits 0.0.0.255 (2 matches) |
9. Route Tagging
Route tags are metadata attached to routes. They do not directly change forwarding preference. Their main value is policy identification, especially during redistribution between routing protocols.
9.1 Why Use Tags?
Identify where a route originated.
Prevent redistributed routes from being sent back into the protocol they came from.
Apply different metrics or filtering to groups of routes.
Make troubleshooting and policy intent easier to interpret.
9.2 Tag During Redistribution
|
ip prefix-list PL-OSPF-EXPORT permit 10.10.10.0/24 ! route-map RM-OSPF-TO-BGP permit 10 match ip address prefix-list PL-OSPF-EXPORT set tag 110 ! router bgp 65001 redistribute ospf 10 route-map RM-OSPF-TO-BGP |
9.3 Filter a Tagged Route
|
route-map RM-BLOCK-TAG deny 10 match tag 110 route-map RM-BLOCK-TAG permit 100 |
In a mutual-redistribution design, the deny sequence can stop a route with tag 110 from being redistributed back toward its original protocol. The exact redistribution command depends on the routing protocols used.
10. Route Filtering with Route Maps
Route filtering controls which prefixes are accepted, advertised, or redistributed. Route maps combine the match logic with a permit/deny decision, making them useful when simple prefix-list attachment is not enough or when attributes must also be changed.
10.1 Outbound BGP Filtering
|
ip prefix-list PL-ADVERTISE seq 10 permit 10.10.10.0/24 ! route-map RM-ISP-OUT permit 10 match ip address prefix-list PL-ADVERTISE set metric 50 route-map RM-ISP-OUT deny 100 ! router bgp 65001 neighbor 203.0.113.2 route-map RM-ISP-OUT out |
10.2 What This Policy Does
Only 10.10.10.0/24 matches the permit sequence.
The route is advertised with the configured MED/metric where applicable.
Any other prefix reaches sequence 100 and is denied.
10.3 Safer Change Practice
Before applying a new outbound route map, verify the prefix list and route map separately. A missing catch-all permit or incorrect prefix length can unintentionally withdraw routes.
11. Routing Attribute Manipulation Example
11.1 BGP Local Preference
Local preference is propagated inside the local AS and is used to choose the preferred outbound path. Higher local preference is preferred.
|
ip prefix-list PL-ALL seq 5 permit 0.0.0.0/0 le 32 ! route-map RM-ISP-A-IN permit 10 match ip address prefix-list PL-ALL set local-preference 200 ! route-map RM-ISP-B-IN permit 10 match ip address prefix-list PL-ALL set local-preference 150 |
11.2 MED
MED can be used to suggest a preferred entry point to a neighboring AS. Lower MED is preferred when the attribute is compared. Its practical effect depends on the receiving network policy.
|
route-map RM-ISP-A-OUT permit 10 match ip address prefix-list PL-ADVERTISE set metric 50 |
11.3 Community
BGP communities label routes so that downstream policies can identify them without matching every prefix individually.
|
route-map RM-COMMUNITY permit 10 match ip address prefix-list PL-ADVERTISE set community 65001:100 additive |
11.4 Weight
Weight is Cisco-specific and local to a single router. Higher weight is preferred and is not advertised to other routers.
|
route-map RM-ISP-A-IN permit 10 set weight 500 |
12. Complete Training Configuration – Dual ISP Policy
12.1 Prefix Lists
|
ip prefix-list PL-ALL seq 5 permit 0.0.0.0/0 le 32 ip prefix-list PL-ADVERTISE seq 10 permit 10.10.10.0/24 |
12.2 Inbound Route Maps
|
route-map RM-ISP-A-IN permit 10 match ip address prefix-list PL-ALL set local-preference 200 ! route-map RM-ISP-B-IN permit 10 match ip address prefix-list PL-ALL set local-preference 150 |
12.3 Outbound Route Map
|
route-map RM-OUT permit 10 match ip address prefix-list PL-ADVERTISE set community 65001:100 additive set metric 50 ! route-map RM-OUT deny 100 |
12.4 BGP Application
|
router bgp 65001 bgp log-neighbor-changes network 10.10.10.0 mask 255.255.255.0 neighbor 203.0.113.2 remote-as 65002 neighbor 203.0.113.2 route-map RM-ISP-A-IN in neighbor 203.0.113.2 route-map RM-OUT out neighbor 198.51.100.2 remote-as 65003 neighbor 198.51.100.2 route-map RM-ISP-B-IN in neighbor 198.51.100.2 route-map RM-OUT out |
Note: example IP addresses are documentation ranges. Adapt interface addressing and neighbor IPs to the actual lab platform.
13. Verification and Show Commands
13.1 Verify Route-Map Counters
|
R2# show route-map RM-ISP-A-IN route-map RM-ISP-A-IN, permit, sequence 10 Match clauses: ip address prefix-lists: PL-ALL Set clauses: local-preference 200 Policy routing matches: 0 packets, 0 bytes |
For route-policy use, focus on the route-map sequences, match objects, set clauses, and any platform-specific route-policy counters. Packet counters shown by the command can relate to PBR and should not be assumed to represent BGP route matches.
13.2 Verify Prefix Lists
|
R2# show ip prefix-list PL-ADVERTISE ip prefix-list PL-ADVERTISE: 1 entries seq 10 permit 10.10.10.0/24 |
13.3 Verify BGP Path Selection
|
R2# show ip bgp Network Next Hop LocPrf Weight Path *> 0.0.0.0 203.0.113.2 200 0 65002 i * 198.51.100.2 150 0 65003 i |
LOOK FOR: the preferred path should show the higher local preference and the best-path marker.
13.4 Verify Advertised Routes
|
R2# show ip bgp neighbors 203.0.113.2 advertised-routes Network Next Hop Metric LocPrf Weight Path *> 10.10.10.0/24 0.0.0.0 50 32768 i |
13.5 Verify Routing Table
|
R2# show ip route 0.0.0.0 Routing entry for 0.0.0.0/0 Known via "bgp 65001" * 203.0.113.2, from 203.0.113.2 |
14. Route-Map Troubleshooting
14.1 Structured Troubleshooting Workflow
Confirm the route map is actually applied to the intended feature and in the correct direction.
Check sequence order and permit/deny actions with show route-map.
Verify the referenced prefix list, ACL, community list, or tag exists and matches the intended routes.
Confirm a catch-all permit is present when unmatched routes should be allowed.
Check whether the desired set statement is valid for the feature that references the route map.
Verify the routing protocol received/advertised routes and the final RIB/FIB outcome.
If policy changed, ensure the routing protocol re-evaluates routes according to platform behavior; use safe route-refresh/soft-policy procedures where applicable.
14.2 Common Problems
|
Symptom |
Likely Cause |
What to Check |
|
All routes disappear after policy is applied |
Implicit deny or wrong prefix list |
show route-map; show ip prefix-list |
|
Route map exists but has no effect |
Not applied, wrong neighbor/direction, wrong feature |
running config; neighbor policy direction |
|
Wrong route is modified |
Match object too broad |
prefix-list ge/le; ACL wildcard; sequence order |
|
Set local preference not visible |
Policy applied outbound or to wrong route |
BGP direction; show ip bgp |
|
Redistribution loop |
No tag or tag filter |
show ip route; route tags; redistribution route maps |
|
Policy works for one prefix but not another |
Prefix length mismatch |
show ip prefix-list detail; route prefix length |
14.3 Troubleshooting Commands
|
show route-map show ip prefix-list show access-lists show ip bgp show ip bgp neighbors <peer> advertised-routes show ip route show ip protocols show running-config | section route-map show running-config | section router bgp |
15. Enterprise Use Cases
|
Use Case |
How Route Maps Help |
|
Dual-ISP path preference |
Set higher local preference on routes learned from the preferred provider. |
|
Selective route advertisement |
Advertise only approved enterprise prefixes to an ISP. |
|
Traffic-engineering hint |
Set MED or communities for upstream policy decisions. |
|
Controlled redistribution |
Permit only selected prefixes and assign metrics/tags. |
|
Loop prevention |
Block routes carrying a tag that indicates they were previously redistributed. |
|
Policy-based forwarding |
Match packet flows and set a specific next hop when PBR is required. |
|
Migration / maintenance |
Temporarily alter attributes to drain or prefer selected paths. |
Quick knowledge check
1. What is the purpose of a route map?
Answer: To create an ordered policy that matches routes/traffic and permits, denies, or modifies them when referenced by another feature.
2. Which sequence is evaluated first?
Answer: The lowest sequence number.
3. What happens if no route-map sequence matches?
Answer: An implicit deny applies in typical route-policy contexts.
4. Why are prefix lists commonly preferred over ACLs for route matching?
Answer: They are designed for prefixes and can match prefix length precisely with ge/le.
5. Does set tag change the route metric?
Answer: No. A tag is metadata used for policy identification and loop prevention.
