Route Map
Route maps are sophisticated policy tools that provide conditional routing decisions by combining flexible match criteria with configurable set actions, enabling complex routing policies for route redistribution, BGP path selection, and traffic engineering. They operate using sequence-based entries that define match conditions (such as prefix lists, access lists, AS paths, or communities) paired with set actions (including metric modification, next-hop assignment, community tagging, and BGP attribute manipulation). Route maps are fundamental building blocks for implementing advanced routing policies, enabling administrators to control route advertisement, path selection, and traffic flow while supporting features like conditional route filtering, multi-homed network optimization, and service provider peering policies.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (iosxe.devices)
Section titled “configuration (iosxe.devices)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
route_maps | List | [route_maps] | No |
route_maps (iosxe.devices.configuration)
Section titled “route_maps (iosxe.devices.configuration)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
name | String | Regex: ^[^\s]*$ | Yes | |
entries | List | [entries] | No |
entries (iosxe.devices.configuration.route_maps)
Section titled “entries (iosxe.devices.configuration.route_maps)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
seq | Integer | min: 0 , max: 65535 | Yes | |
operation | Choice | deny , permit | No | |
description | String | No | ||
continue | Boolean | true , false | No | |
continue_sequence_number | Integer | min: 0 , max: 65535 | No | |
match | Class | [match] | No | |
set | Class | [set] | No |
match (iosxe.devices.configuration.route_maps.entries)
Section titled “match (iosxe.devices.configuration.route_maps.entries)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
interfaces | List | String | No | |
ipv4_address_access_lists | List | String | No | |
ipv4_address_prefix_lists | List | String | No | |
ipv4_next_hop_access_lists | List | String | No | |
ipv4_next_hop_prefix_lists | List | String | No | |
ipv6_address_access_lists | String | No | ||
ipv6_address_prefix_lists | String | No | ||
ipv6_next_hop_access_lists | String | No | ||
ipv6_next_hop_prefix_lists | String | No | ||
route_type | Class | [route_type] | No | |
source_protocol | Class | [source_protocol] | No | |
tags | List | Integer | No | |
track | Integer | min: 1 , max: 1000 | No | |
as_paths | List | Integer | No | |
community_lists | List | String | No | |
community_list_exact_match | Boolean | true , false | No | |
extcommunity_lists | List | String | No | |
local_preferences | List | Integer | No |
set (iosxe.devices.configuration.route_maps.entries)
Section titled “set (iosxe.devices.configuration.route_maps.entries)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
default_interfaces | List | String | No | |
global | Boolean | true , false | No | |
interfaces | List | String | No | |
ipv4_address | String | No | ||
ipv4_default_global_next_hop_addresses | List | String | No | |
ipv4_default_next_hop_addresses | List | String | No | |
ipv4_global_next_hop_addresses | List | String | No | |
ipv4_next_hop_addresses | List | String | No | |
ipv4_next_hop_self | Boolean | true , false | No | |
ipv4_qos_group | Integer | min: 0 , max: 99 | No | |
ipv6_addresses | List | String | No | |
ipv6_default_global_next_hop | String | No | ||
ipv6_default_next_hop_addresses | List | String | No | |
ipv6_next_hop_addresses | List | String | No | |
level_1 | Boolean | true , false | No | |
level_1_2 | Boolean | true , false | No | |
level_2 | Boolean | true , false | No | |
metric_change | String | No | ||
metric_value | Integer | min: 0 , max: 4294967295 | No | |
metric_delay | String | No | ||
metric_reliability | Integer | min: 0 , max: 255 | No | |
metric_loading | Integer | min: 1 , max: 255 | No | |
metric_mtu | Integer | min: 1 , max: 4294967295 | No | |
metric_type | Choice | external , internal , type-1 , type-2 | No | |
tag | Integer | min: 0 , max: 4294967295 | No | |
vrf | String | No | ||
as_path_prepend_as | String | No | ||
as_path_prepend_last_as | Integer | min: 1 , max: 10 | No | |
as_path_tag | Boolean | true , false | No | |
as_path_replace_any | Boolean | true , false | No | |
as_path_replace_as | List | String | No | |
community_none | Boolean | true , false | No | |
communities | List | String | No | |
communities_additive | Boolean | true , false | No | |
community_list_delete | Boolean | true , false | No | |
community_list_standard | Integer | min: 1 , max: 99 | No | |
community_list_expanded | Integer | min: 100 , max: 500 | No | |
community_list_name | String | No | ||
extcomunity_rt | List | String | No | |
extcomunity_soo | String | No | ||
extcomunity_vpn_distinguisher | String | No | ||
extcomunity_vpn_distinguisher_additive | Boolean | true , false | No | |
local_preference | Integer | min: 0 , max: 4294967295 | No | |
weight | Integer | min: 0 , max: 65535 | No |
route_type (iosxe.devices.configuration.route_maps.entries.match)
Section titled “route_type (iosxe.devices.configuration.route_maps.entries.match)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
external | Boolean | true , false | No | |
external_type_1 | Boolean | true , false | No | |
external_type_2 | Boolean | true , false | No | |
internal | Boolean | true , false | No | |
level_1 | Boolean | true , false | No | |
level_2 | Boolean | true , false | No | |
local | Boolean | true , false | No |
source_protocol (iosxe.devices.configuration.route_maps.entries.match)
Section titled “source_protocol (iosxe.devices.configuration.route_maps.entries.match)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
bgp | List | String | No | |
connected | Boolean | true , false | No | |
eigrp | List | String | No | |
isis | Boolean | true , false | No | |
lisp | Boolean | true , false | No | |
ospf | List | String | No | |
ospfv3 | List | String | No | |
rip | Boolean | true , false | No | |
static | Boolean | true , false | No |
By combining match criteria with set actions, route maps enable flexible, conditional routing policies for precise control over route advertisement and traffic flow.
Route Map Parameters
Section titled “Route Map Parameters”Key Components:
Route Map Name (
name
): The identifier for the route map.Entry Sequence Number (
entries.seq
): The sequence number for each route map entry.Operation (
entries.operation
): Specifies whether the entry permits or denies matched routes.Match Criteria (
entries.match
): Defines conditions for route selection (e.g., prefix-list, access-list, AS-path, community-list, interface, tag, protocol).Set Actions (
entries.set
): Specifies actions to apply to matched routes (e.g., metric, next-hop, local preference, community, AS-path prepend, tag).Description (
entries.description
): Adds descriptive text to route map entries.
Key Parameters Briefly Explained:
name
: Route map identifier.entries.seq
: Entry sequence number.entries.operation
: Permit or deny action.entries.match
: Match conditions for route selection.entries.set
: Actions applied to matched routes.entries.description
: Entry description.
You can use these Route Map parameters to define granular and conditional routing policies. Customize match conditions and set actions to fit your network’s traffic engineering, route redistribution, and BGP path selection requirements. Adjusting these parameters lets you precisely control how routes are advertised, filtered, and preferred across your network.
Sample Configuration
Section titled “Sample Configuration”The following configuration describes how to set up route maps on a Cisco IOS-XE device, including route map entries with permit/deny actions, match conditions, and set actions for advanced routing policies.
ip prefix-list CUSTOMER-PREFIXES seq 5 permit 10.0.0.0/8 le 24ip prefix-list BACKUP-PREFIXES seq 5 permit 172.16.0.0/16 le 24!route-map BGP-IN-FILTER permit 10 description Allow specific prefixes and set local preference match ip address prefix-list CUSTOMER-PREFIXES set local-preference 200 set community 65001:100!route-map BGP-IN-FILTER permit 20 description Allow remaining prefixes with default preference match ip address prefix-list BACKUP-PREFIXES set local-preference 100!route-map BGP-OUT-FILTER permit 10 description Advertise internal routes with community match ip address prefix-list INTERNAL-ROUTES set as-path prepend 65001 65001 set community 65001:200!route-map BGP-OUT-FILTER permit 20 description Set next-hop for specific interfaces match interface GigabitEthernet0/0/1 set ip next-hop 192.168.1.1 set metric 100!route-map BGP-OUT-FILTER deny 30 description Deny all other routes
Example YAML Code
Section titled “Example YAML Code”The following YAML code defines multiple route maps on an IOS-XE device, specifying entries with sequence numbers, permit/deny operations, match criteria, and set actions for advanced routing policies.
iosxe: devices: - name: Device1 configuration: route_maps: - name: BGP-IN-FILTER entries: - seq: 10 operation: permit description: Allow specific prefixes and set local preference match: ipv4_address_prefix_lists: - CUSTOMER-PREFIXES set: local_preference: 200 communities: - "65001:100" - seq: 20 operation: permit description: Allow remaining prefixes with default preference match: ipv4_address_prefix_lists: - BACKUP-PREFIXES set: local_preference: 100 - name: BGP-OUT-FILTER entries: - seq: 10 operation: permit description: Advertise internal routes with community match: source_protocol: connected: true static: true set: as_path_prepend_as: "65001 65001" communities: - "65001:200" - seq: 20 operation: permit description: Set next-hop for specific interfaces match: interfaces: - GigabitEthernet0/0/1 set: ipv4_next_hop_addresses: - 192.168.1.1 metric_value: 100 - seq: 30 operation: deny description: Deny all other routes