Skip to content

Prefix List

Prefix lists are powerful route filtering tools that provide precise control over route advertisements and acceptance by matching IP prefixes based on network address and subnet mask length criteria, offering more granular control than traditional access lists. They support flexible matching conditions including exact prefix matches, prefix length ranges using greater-equal and less-equal operators, and sequence-based processing that enables complex routing policies for BGP, OSPF, and other routing protocols. Prefix lists are essential for implementing routing security, controlling route propagation, preventing route leaks, and optimizing routing table size by filtering unwanted or unnecessary routes at redistribution points and routing protocol boundaries.

Diagram

Diagram

Classes

configuration (iosxe.devices)

NameTypeConstraintMandatoryDefault Value
prefix_listsList[prefix_lists]No

prefix_lists (iosxe.devices.configuration)

NameTypeConstraintMandatoryDefault Value
nameStringRegex: ^[^\s]*$Yes
descriptionStringNo
seqsList[seqs]No

seqs (iosxe.devices.configuration.prefix_lists)

NameTypeConstraintMandatoryDefault Value
seqIntegermin: 1, max: 4294967294Yes
actionChoicedeny, permitNo
prefixIPNo
greater_equalIntegermin: 1, max: 32No
less_equalIntegermin: 1, max: 32No

Examples

iosxe:
devices:
- name: Device1
configuration:
prefix_lists:
- name: ALLOW-PRIVATE-NETWORKS
description: Allow private network prefixes
seqs:
- seq: 10
action: permit
prefix: 10.0.0.0/8
greater_equal: 24
less_equal: 32
- seq: 20
action: permit
prefix: 172.16.0.0/12
greater_equal: 16
less_equal: 24
- seq: 30
action: permit
prefix: 192.168.0.0/16
greater_equal: 24
less_equal: 32
- name: DENY-DEFAULT-ROUTE
description: Deny default route advertisements
seqs:
- seq: 10
action: deny
prefix: 0.0.0.0/0