Skip to content

Routing Set

Routing sets are named collections of values used by IOS-XR Route Policy Language (RPL) to match route attributes such as prefixes, AS paths, communities, and route targets. They are referenced within route policies for filtering, redistribution control, and traffic engineering. All routing set types are managed under a single routing_sets list with a type field to distinguish between set types.

Diagram
NameTypeConstraintMandatoryDefault Value
routing_setsList[routing_sets]No

routing_sets (iosxr.devices.configuration)

Section titled “routing_sets (iosxr.devices.configuration)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
typeChoiceas_path, community, esi, etag, extcommunity_bandwidth, extcommunity_cost, extcommunity_evpn_link_bandwidth, extcommunity_opaque, extcommunity_rt, extcommunity_seg_nh, extcommunity_soo, large_community, mac, ospf_area, policy_global, prefix, rd, tagYes
rplStringYes

RPL YAML Formats

RPL can be expressed in two different formats in YAML:

  1. Inline format - Uses escaped newline characters (\n) within a quoted string. This matches how the device stores RPL data in the YANG model. Compact but harder to read for complex policies.
  2. Multi-line format - Uses the YAML literal block scalar (|) to preserve newlines. This closely mirrors the RPL CLI output on the device. More readable for complex policies with conditional logic.

Both formats produce identical results and can be used interchangeably. The normalization layer handles both before sending to the device.

Inline format:

routing_sets:
- name: "BGP_PEER_PREFIXES"
type: prefix
rpl: "prefix-set BGP_PEER_PREFIXES\n 10.1.1.0/24 ge 24 le 32,\n 172.16.0.0/12 ge 16 le 24\nend-set\n"

Multi-line format:

routing_sets:
- name: "BGP_PEER_PREFIXES"
type: prefix
rpl: |
prefix-set BGP_PEER_PREFIXES
10.1.1.0/24 ge 24 le 32,
172.16.0.0/12 ge 16 le 24
end-set

Example-1: AS path set for filtering transit provider routes.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "TRANSIT_AS_PATHS"
type: as_path
rpl: |
as-path-set TRANSIT_AS_PATHS
ios-regex '_3356_',
ios-regex '_1299_',
ios-regex '_174_',
ios-regex '_6461_'
end-set

Example-2: Community set for traffic engineering with well-known communities (inline).

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "TE_COMMUNITIES"
type: community
rpl: "community-set TE_COMMUNITIES\n 65000:100,\n 65000:200,\n no-export,\n local-AS\nend-set\n"

Example-3: Community set with range matching and wildcards.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "CUSTOMER_COMMUNITIES"
type: community
rpl: |
community-set CUSTOMER_COMMUNITIES
[65001..65099]:100,
[65001..65099]:200,
65000:*
end-set

Example-4: ESI set for EVPN multihoming.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "DC1_DUAL_HOME_ESI"
type: esi
rpl: |
esi-set DC1_DUAL_HOME_ESI
0001.0001.0001.0001.0001,
0001.0001.0001.0001.0002,
0001.0001.0001.0001.0003
end-set

Example-5: Etag set for EVPN ethernet segment tagging.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "VXLAN_ETAGS"
type: etag
rpl: |
etag-set VXLAN_ETAGS
10001,
10002,
10003
end-set

Example-6: Bandwidth community for BGP link-bandwidth steering.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "UPLINK_BANDWIDTH"
type: extcommunity_bandwidth
rpl: |
extcommunity-set bandwidth UPLINK_BANDWIDTH
65001:1000,
65001:10000
end-set

Example-7: Cost community for BGP best-path influence.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "BACKUP_PATH_COST"
type: extcommunity_cost
rpl: |
extcommunity-set cost BACKUP_PATH_COST
IGP:1:100,
Pre-Bestpath:1:50
end-set

Example-8: EVPN link-bandwidth for weighted ECMP.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "EVPN_ECMP_WEIGHTS"
type: extcommunity_evpn_link_bandwidth
rpl: |
extcommunity-set evpn-link-bandwidth EVPN_ECMP_WEIGHTS
0:10000,
1:10000
end-set

Example-9: Opaque community with color flag for SR-TE policy steering.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "SRTE_COLORS"
type: extcommunity_opaque
rpl: |
extcommunity-set opaque SRTE_COLORS
100 co-flag 01,
200 co-flag 01,
300
end-set

Example-10: Route target set for L3VPN import/export.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "VPN_CUSTOMER_A_RT"
type: extcommunity_rt
rpl: |
extcommunity-set rt VPN_CUSTOMER_A_RT
65000:1001,
65000:1002,
10.0.0.1:100
end-set

Example-11: Segmented next-hop set for P2MP multicast tunnels.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "MCAST_NEXTHOPS"
type: extcommunity_seg_nh
rpl: |
extcommunity-set seg-nh MCAST_NEXTHOPS
10.0.0.1,
10.0.0.2,
10.0.0.3
end-set

Example-12: Site-of-origin set for multi-homed CE loop prevention.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "SITE_EAST_SOO"
type: extcommunity_soo
rpl: |
extcommunity-set soo SITE_EAST_SOO
65000:100,
10.0.0.1:100
end-set

Example-13: Large community set for ISP policy signaling.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "ISP_ACTION_COMMUNITIES"
type: large_community
rpl: |
large-community-set ISP_ACTION_COMMUNITIES
65000:100:1,
65000:100:2,
65000:*:*
end-set

Example-14: MAC set for EVPN MAC-based filtering.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "BLOCKED_MACS"
type: mac
rpl: |
mac-set BLOCKED_MACS
0000.5e00.0101,
0100.0ccc.cccc,
0180.c200.0000
end-set

Example-15: OSPF area set for redistribution control.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "OSPF_STUB_AREAS"
type: ospf_area
rpl: |
ospf-area-set OSPF_STUB_AREAS
1,
2,
0.0.0.10
end-set

Example-16: Policy global set for reusable RPL variables.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "POLICY_GLOBAL_SET"
type: policy_global
rpl: |
policy-global
LOCAL_PREF '150',
DEFAULT_MED '100'
end-global

Example-17: IPv4 prefix set for BGP inbound filtering.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "CUSTOMER_A_PREFIXES"
type: prefix
rpl: |
prefix-set CUSTOMER_A_PREFIXES
10.1.0.0/16 ge 16 le 24,
10.2.0.0/16 ge 16 le 24,
192.168.100.0/24 eq 32
end-set

Example-18: IPv6 prefix set for provider-assigned address space.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "IPV6_PA_SPACE"
type: prefix
rpl: |
prefix-set IPV6_PA_SPACE
2001:db8::/32 ge 48 le 64,
2001:db8:1::/48 eq 128,
fc00::/7
end-set

Example-19: RD set for VPN route distinguisher matching.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "DC_WEST_RD"
type: rd
rpl: |
rd-set DC_WEST_RD
65000:100,
65000:200,
10.0.0.1:100,
match any
end-set

Example-20: Tag set for OSPF route redistribution tagging.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
routing_sets:
- name: "OSPF_REDIST_TAGS"
type: tag
rpl: |
tag-set OSPF_REDIST_TAGS
100,
200,
300
end-set