set routing prefix-list


The set routing prefix-list command creates an IPv4/IPv6 prefix list or an entry in an IPv4/IPv6 prefix list.

The delete routing prefix-list command deletes an IPv4/IPv6 prefix list or an entry from an IPv4/IPv6 prefix list.


Command Syntax

set routing prefix-list {ipv4-family <ipv4-prefix-name> | ipv6-family <ipv6-prefix-name>} [seq <sequence-number>] {deny|permit} {prefix <ipaddress/prefixlen> [ge <greater-equal-value>] [le <less-equal-value>prefix-any}

delete routing prefix-list {ipv4-family <ipv4-prefix-name> | ipv6-family <ipv6-prefix-name>} [seq <sequence-number>]deny|permit} {prefix <ipaddress/prefixlen> [ge <greater-equal-value>] [le <less-equal-value>prefix-any}


Parameter

Parameter

Description

<ip4-prefix-name>

Specifies the name of an IPv4 prefix list.
<ip6-prefix-name>Specifies the name of an IPv6 prefix list.

seq <sequence-number>

Optional. Specifies the sequence number of an entry in the IP prefix list. The value is an integer that ranges from 1 to 4294967295.

NOTE:

When configuring IP prefix list, it is strongly recommended to configure sequence number for each IP prefix list nodeOtherwise, the precedence of this IP prefix list will be uncertain, and thus the desired IP filtering effect will not be achieved.

{deny|permit}

Specifies whether the route is available for further processing when there is a match. The value could be deny or permit.

  • deny: In deny mode, if the IP address to be filtered is within the defined prefix range, the IP address fails to match the routing policy and cannot match the next entry.
  • permit:  In permit mode, if the IP address to be filtered is within the defined prefix range, the IP address matches the routing policy and does not continue to match the next entry. 

{prefix <ipaddress/prefixlen> | prefix-any}

Specifies an IP address/prefix length or all addresses. The value of prefix length is an integer that ranges from 1 to 32 for IPv4 addresses, and 1 to 128 for IPv6 addresses.

When prefix-any is specified, it creates a prefix-list that matches all addresses.

ge <greater-equal-value>

Optional. Specifies the lower threshold of the mask length. It can be used when an IP address/prefix length is specified.

If ge greater-equal-value and le less-equal-value are not specified, the value of prefix length is the mask length.

For IPv4:

  • greater-equal-value must meet the following requirement: prefixlengreater-equal-value ≤ less-equal-value ≤ 32.
  • If only ge is configured, the mask ranges from greater-equal-value to 32.

For IPv6:

  • greater-equal-value must meet the following requirement: prefixlengreater-equal-value ≤ less-equal-value ≤ 128.
  • If only ge is configured, the mask ranges from greater-equal-value to 128.
le <less-equal-value>

Optional. Specifies the upper threshold of the mask length. It can be used when an IP address/prefix length is specified.

If ge greater-equal-value and le less-equal-value are not specified, the value of prefix length is the mask length.

For IPv4:

  • less-equal-value must meet the following requirement: prefixlengreater-equal-value ≤ less-equal-value ≤ 32.
  • If only le is configured, the mask ranges from prefixlen to less-equal-value.

For IPv6:

  • less-equal-value must meet the following requirement: prefixlengreater-equal-value ≤ less-equal-value ≤ 128.
  • If only le is configured, the mask ranges from prefixlen to less-equal-value.


Example

  • Configure the IPv4 prefix list named p1 to permit only the routes with the mask length ranging from 8 to 16 on the network segment 35.0.0.0/8.

admin@Xorplus# set routing prefix-list ipv4-family p1 seq 1 permit prefix 35.0.0.0/8 ge 16
admin@Xorplus# commit
  • Configure the IPv6 prefix list named p2 to permit the routes with the mask length ranging from 32 to 64 bits.

admin@Xorplus# set routing prefix-list ipv6-family p2 seq 1 permit prefix ::/0 ge 32 le 64
admin@Xorplus# commit

Copyright © 2024 Pica8 Inc. All Rights Reserved.