Prefix List
IOS-XRConfigure 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”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| devices | List | devices | No | |
| device_groups | List | device_groups | No | |
| global | Class | global | No |
devices (iosxr)
Section titled “devices (iosxr)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
device_groups (iosxr)
Section titled “device_groups (iosxr)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
global (iosxr)
Section titled “global (iosxr)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
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)”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 | |
| length | Integer | min: 0, max: 32 | 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 | |
| length | 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.
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 length: 24 exact_length: 24 - sequence: 20 action: deny prefix: 0.0.0.0 length: 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 length: 24 exact_length: 24 - sequence: 20 action: permit prefix: 10.0.0.0 length: 8 min_length: 8 max_length: 24 - sequence: 25 remark: "Deny all others" - sequence: 30 action: deny prefix: 0.0.0.0 length: 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::" length: 48 min_length: 64 max_length: 128 - sequence: 20 action: deny prefix: "::" length: 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 length: 24 exact_length: 24 - name: LOOPBACK_NETWORKS entries: - sequence: 10 action: permit prefix: 172.16.0.0 length: 12 exact_length: 32 ipv6: - name: IPV6_MGMT entries: - sequence: 10 action: permit prefix: "2001:db8:1::" length: 48 min_length: 64 max_length: 128 - name: IPV6_LOOPBACKS entries: - sequence: 10 action: permit prefix: "2001:db8:ffff::" length: 48 exact_length: 128