Prefix List
Configure IPv4 and IPv6 prefix lists for route filtering and access control. Prefix lists provide a powerful mechanism to filter routes based on network prefixes and prefix lengths, commonly used in routing policies, route maps, and access control.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (iosxr.devices)
Section titled “configuration (iosxr.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| prefix_lists | Class | [prefix_lists] | No |
prefix_lists (iosxr.devices.configuration)
Section titled “prefix_lists (iosxr.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ipv4 | List | [ipv4] | No | |
| ipv6 | List | [ipv6] | No |
ipv4 (iosxr.devices.configuration.prefix_lists)
Section titled “ipv4 (iosxr.devices.configuration.prefix_lists)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | max: 32 | Yes | |
| entries | List | [entries] | No |
ipv6 (iosxr.devices.configuration.prefix_lists)
Section titled “ipv6 (iosxr.devices.configuration.prefix_lists)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | max: 32 | Yes | |
| entries | List | [entries] | No |
entries (iosxr.devices.configuration.prefix_lists.ipv4)
Section titled “entries (iosxr.devices.configuration.prefix_lists.ipv4)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| sequence | Integer | min: 1, max: 2147483646 | Yes | |
| action | Choice | deny, permit | No | |
| exact_length | Integer | min: 0, max: 32 | No | |
| mask | Any | String or Integer[min: 0, max: 32] or String[Regex: ^.*[\$\%]\{.*$] | No | |
| max_length | Integer | min: 0, max: 32 | No | |
| min_length | Integer | min: 0, max: 32 | No | |
| prefix | IP | No | ||
| remark | String | No |
entries (iosxr.devices.configuration.prefix_lists.ipv6)
Section titled “entries (iosxr.devices.configuration.prefix_lists.ipv6)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| sequence | Integer | min: 1, max: 2147483646 | Yes | |
| action | Choice | deny, permit | No | |
| exact_length | Integer | min: 0, max: 128 | No | |
| mask | Integer | min: 0, max: 128 | No | |
| max_length | Integer | min: 0, max: 128 | No | |
| min_length | Integer | min: 0, max: 128 | No | |
| prefix | IP | No | ||
| remark | String | No | ||
| zone | Integer | min: 0, max: 4294967295 | No |
Guidelines and Limitations
Section titled “Guidelines and Limitations”- IPv6 prefix list remarks (
remark) are not supported via gNMI. Use remarks only in IPv4 prefix lists.
Data Normalization
Section titled “Data Normalization”IPv4 Mask Formats
The IPv4 mask field accepts both dotted-decimal and prefix-length:
- dotted-decimal (e.g.,
255.255.255.0) - prefix-length integer (e.g.,
24)
Both formats can be used interchangeably. The normalization layer automatically converts prefix-length integers to dotted-decimal before sending to the device, preventing configuration drift.
Example YAML Code:
Section titled “Example YAML Code:”Example-1: IPv4 prefix list with permit and deny entries.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: prefix_lists: ipv4: - name: MGMT_NETWORKS entries: - sequence: 10 action: permit prefix: 192.168.1.0 mask: 255.255.255.0 exact_length: 24 - sequence: 20 action: deny prefix: 0.0.0.0 mask: 0.0.0.0Example-2: IPv4 prefix list with remarks and range matching.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: prefix_lists: ipv4: - name: MGMT_NETWORKS entries: - sequence: 5 remark: "Allow management subnet" - sequence: 10 action: permit prefix: 192.168.1.0 mask: 24 exact_length: 24 - sequence: 20 action: permit prefix: 10.0.0.0 mask: 255.0.0.0 min_length: 8 max_length: 24 - sequence: 25 remark: "Deny all others" - sequence: 30 action: deny prefix: 0.0.0.0 mask: 0.0.0.0Example-3: IPv6 prefix list with permit/deny entries and zone.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: prefix_lists: ipv6: - name: IPV6_MGMT entries: - sequence: 10 action: permit prefix: "2001:db8:1::" mask: 48 min_length: 64 max_length: 128 - sequence: 20 action: deny prefix: "::" mask: 0Example-4: IPv4 and IPv6 prefix lists on one device.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: prefix_lists: ipv4: - name: MGMT_NETWORKS entries: - sequence: 10 action: permit prefix: 192.168.1.0 mask: 255.255.255.0 exact_length: 24 - name: LOOPBACK_NETWORKS entries: - sequence: 10 action: permit prefix: 172.16.0.0 mask: 255.240.0.0 exact_length: 32 ipv6: - name: IPV6_MGMT entries: - sequence: 10 action: permit prefix: "2001:db8:1::" mask: 48 min_length: 64 max_length: 128 - name: IPV6_LOOPBACKS entries: - sequence: 10 action: permit prefix: "2001:db8:ffff::" mask: 48 exact_length: 128