Skip to content

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
NameTypeConstraintMandatoryDefault Value
route_mapsList[route_maps]No

NameTypeConstraintMandatoryDefault Value
nameStringRegex: ^[^\s]*$Yes
entriesList[entries]No

entries (iosxe.devices.configuration.route_maps)

Section titled “entries (iosxe.devices.configuration.route_maps)”
NameTypeConstraintMandatoryDefault Value
seqIntegermin: 0, max: 65535Yes
operationChoicedeny, permitNo
descriptionStringNo
continueBooleantrue, falseNo
continue_sequence_numberIntegermin: 0, max: 65535No
matchClass[match]No
setClass[set]No

match (iosxe.devices.configuration.route_maps.entries)

Section titled “match (iosxe.devices.configuration.route_maps.entries)”
NameTypeConstraintMandatoryDefault Value
interfacesListStringNo
ipv4_address_access_listsListStringNo
ipv4_address_prefix_listsListStringNo
ipv4_next_hop_access_listsListStringNo
ipv4_next_hop_prefix_listsListStringNo
ipv6_address_access_listsStringNo
ipv6_address_prefix_listsStringNo
ipv6_next_hop_access_listsStringNo
ipv6_next_hop_prefix_listsStringNo
route_typeClass[route_type]No
source_protocolClass[source_protocol]No
tagsListIntegerNo
trackIntegermin: 1, max: 1000No
as_pathsListIntegerNo
community_listsListStringNo
community_list_exact_matchBooleantrue, falseNo
extcommunity_listsListStringNo
local_preferencesListIntegerNo

set (iosxe.devices.configuration.route_maps.entries)

Section titled “set (iosxe.devices.configuration.route_maps.entries)”
NameTypeConstraintMandatoryDefault Value
default_interfacesListStringNo
globalBooleantrue, falseNo
interfacesListStringNo
ipv4_addressStringNo
ipv4_default_global_next_hop_addressesListStringNo
ipv4_default_next_hop_addressesListStringNo
ipv4_global_next_hop_addressesListStringNo
ipv4_next_hop_addressesListStringNo
ipv4_next_hop_selfBooleantrue, falseNo
ipv4_qos_groupIntegermin: 0, max: 99No
ipv6_addressesListStringNo
ipv6_default_global_next_hopStringNo
ipv6_default_next_hop_addressesListStringNo
ipv6_next_hop_addressesListStringNo
level_1Booleantrue, falseNo
level_1_2Booleantrue, falseNo
level_2Booleantrue, falseNo
metric_changeStringNo
metric_valueIntegermin: 0, max: 4294967295No
metric_delayStringNo
metric_reliabilityIntegermin: 0, max: 255No
metric_loadingIntegermin: 1, max: 255No
metric_mtuIntegermin: 1, max: 4294967295No
metric_typeChoiceexternal, internal, type-1, type-2No
tagIntegermin: 0, max: 4294967295No
vrfStringNo
as_path_prepend_asStringNo
as_path_prepend_last_asIntegermin: 1, max: 10No
as_path_tagBooleantrue, falseNo
as_path_replace_anyBooleantrue, falseNo
as_path_replace_asListStringNo
community_noneBooleantrue, falseNo
communitiesListStringNo
communities_additiveBooleantrue, falseNo
community_list_deleteBooleantrue, falseNo
community_list_standardIntegermin: 1, max: 99No
community_list_expandedIntegermin: 100, max: 500No
community_list_nameStringNo
extcomunity_rtListStringNo
extcomunity_sooStringNo
extcomunity_vpn_distinguisherStringNo
extcomunity_vpn_distinguisher_additiveBooleantrue, falseNo
local_preferenceIntegermin: 0, max: 4294967295No
weightIntegermin: 0, max: 65535No

route_type (iosxe.devices.configuration.route_maps.entries.match)

Section titled “route_type (iosxe.devices.configuration.route_maps.entries.match)”
NameTypeConstraintMandatoryDefault Value
externalBooleantrue, falseNo
external_type_1Booleantrue, falseNo
external_type_2Booleantrue, falseNo
internalBooleantrue, falseNo
level_1Booleantrue, falseNo
level_2Booleantrue, falseNo
localBooleantrue, falseNo

source_protocol (iosxe.devices.configuration.route_maps.entries.match)

Section titled “source_protocol (iosxe.devices.configuration.route_maps.entries.match)”
NameTypeConstraintMandatoryDefault Value
bgpListStringNo
connectedBooleantrue, falseNo
eigrpListStringNo
isisBooleantrue, falseNo
lispBooleantrue, falseNo
ospfListStringNo
ospfv3ListStringNo
ripBooleantrue, falseNo
staticBooleantrue, falseNo

By combining match criteria with set actions, route maps enable flexible, conditional routing policies for precise control over route advertisement and traffic flow.

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.

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 24
ip 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

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