Condition clauses usually follow if or elseif and are used to set matching rules to filter routes.
The parameters in condition clauses can be specific values or global variables referenced using $+global variable name. The parameters in a route-filter with pre-defined variables can be those defined in this route-filter.
Global variables cannot be referenced by the route attribute sets in the format of {element, element...}.
Condition Clause |
Function |
Parameters |
Commands Used to Apply Condition Clauses |
---|---|---|---|
ip route-source in { ip-prefix-list-name | ip-prefix-list } |
Matches the IPv4 routes carrying the specified source address. |
ip-prefix-list-name: indicates the name of an IPv4 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ip-prefix-list: indicates the IPv4 prefix set in the format of {element, element...}, in which the elements are IPv4 addresses carrying mask lengths, for example, { 1.1.1.0 24, 2.2.2.2 32 }. |
|
ipv6 route-source in { ipv6-prefix-list-name | ipv6-prefix-list } |
Matches the IPv6 routes carrying the specified source address. |
ipv6-prefix-list-name: indicates the name of an IPv6 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ipv6-prefix-list: indicates the IPv6 prefix set in the format of {element, element...}, in which the elements are IPv6 addresses carrying mask lengths. |
|
ip route-destination in { ip-prefix-list-name | ip-prefix-list } |
Matches the IPv4 routes carrying the specified destination address. |
ip-prefix-list-name: indicates the name of an IPv4 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ip-prefix-list: indicates the IPv4 prefix set in the format of {element, element...}, in which the elements are IPv4 addresses carrying mask lengths. |
|
ipv6 route-destination in { ipv6-prefix-list-name | ipv6-prefix-list } |
Matches the IPv6 routes carrying the specified destination IPv6 address. |
ipv6-prefix-list-name: indicates the name of an IPv6 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ipv6-prefix-list: indicates the IPv6 prefix set in the format of {element, element...}, in which the elements are IPv6 addresses carrying mask lengths. |
|
ip next-hop in { ip-prefix-list-name | ip-prefix-list } |
Matches the IPv4 routes carrying the specified next hop IP address. |
ip-prefix-list-name: indicates the name of an IPv4 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ip-prefix-list: indicates the IPv4 prefix set in the format of {element, element...}, in which the elements are IPv4 addresses carrying mask lengths. |
|
ipv6 next-hop in { ipv6-prefix-list-name | ipv6-prefix-list } |
Matches the IPv6 routes carrying the specified next hop address. |
ipv6-prefix-list-name: indicates the name of an IPv6 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ipv6-prefix-list: indicates the IPv6 prefix set in the format of {element, element...}, in which the elements are IPv6 addresses carrying mask lengths. |
|
Condition Clause |
Function |
Parameters |
Commands Used to Apply Condition Clauses |
---|---|---|---|
local-preference eq preference |
Matches the BGP routes with the Local_Pref value being preference. |
preference: indicates an integer ranging from 0 to 4294967295. |
|
local-preference ge preference |
Matches the BGP routes with the Local_Pref value greater than or equal to preference. |
preference: indicates an integer ranging from 0 to 4294967295. |
|
local-preference le preference |
Matches the BGP routes with the Local_Pref value less than or equal to preference. |
preference: indicates an integer ranging from 0 to 4294967295. |
|
Condition Clause |
Function |
Parameters |
Commands Used to Apply Condition Clauses |
---|---|---|---|
as-path in { as-path-list-name | as-path-list } |
Matches the BGP routes carrying the AS_Path in the specified AS_Path set. |
as-path-list-name: indicates the name of an AS_Path set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. as-path-list: indicates the AS_Path set in the format of {element, element...}, in which the elements are in the format of regular+AS_Path regular expression. |
|
as-path is-none |
Matches the BGP routes carrying an empty AS_Path (locally generated BGP routes). |
– |
|
as-path origin as-path [ whole-match ] |
Matches BGP routes with AS_Path whose rightmost AS numbers are the same as as-path. |
as-path: indicates the AS_Path, enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. whole-match: indicates that duplicate AS numbers are counted independently during matching. If this parameter is not specified, duplicate AS numbers are counted as one AS number during matching. |
|
as-path pass as-path [ whole-match ] |
Matches BGP routes with AS_Path whose contiguous AS numbers match as-path. |
as-path: indicates the AS_Path, enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. whole-match: indicates that duplicate AS numbers are counted independently during matching. If this parameter is not specified, duplicate AS numbers are counted as one AS number during matching. |
|
as-path peer-is as-path [ whole-match ] |
Matches BGP routes with AS_Path whose leftmost AS numbers are the same as as-path. |
as-path: indicates the AS_Path, enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. whole-match: indicates that duplicate AS numbers are counted independently during matching. If this parameter is not specified, duplicate AS numbers are counted as one AS number during matching. |
|
as-path length { eq | ge | le } as-path-number |
Matches the routes carrying the AS_Path with the length equal to the specified length, greater than or equal to the specified length, or less than or equal to the specified length.
|
as-path-number: indicates the AS_Path length. The value is an integer ranging from 0 to 2047. |
|
as-path unique-length { eq | ge | le } as-path-number |
Matches the routes carrying the AS_Path with the length equal to the specified length, greater than or equal to the specified length, or less than or equal to the specified length (with duplicate AS numbers counted as one AS number).
|
as-path-number: indicates the AS_Path length. The value is an integer ranging from 0 to 2047. |
|
Condition Clause |
Function |
Parameters |
Commands Used to Apply Condition Clauses |
---|---|---|---|
community matches-any { community-list-name | community-list } |
Matches the BGP routes carrying at least one of the communities specified in the community set. |
community-list-name: indicates the name of a community set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. community-list: indicates the community set in the format of {element, element...}, in which the elements are in the format of aa:nn, a community number, or a known community (internet, no-export-subconfed, no-advertise, or no-export). |
|
community matches-all { community-list-name | community-list } |
Matches the BGP routes carrying the communities of which the specified community set is a subset. |
community-list-name: indicates the name of a community set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. community-list: indicates the community set in the format of {element, element...}, in which the elements are in the format of aa:nn, a community number, or a known community (internet, no-export-subconfed, no-advertise, or no-export). |
|
community matches-within { community-list-name | community-list } |
Matches the BGP routes carrying the communities listed in the specified community set or less communities. |
community-list-name: indicates the name of a community set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. community-list: indicates the community set in the format of {element, element...}, in which the elements are in the format of aa:nn, a community number, or a known community (internet, no-export-subconfed, no-advertise, or no-export). |
|
community is-none |
Matches the BGP routes with an empty community. |
- |
|
Condition Clause |
Function |
Parameters |
Commands Used to Apply Condition Clauses |
---|---|---|---|
rd in { rd-list-name | rd-list } |
Matches the VPN routes with RDs in the specified RD set. |
rd-list-name: indicates the name of an RD set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. rd-list: indicates the RD set in the format of {element, element...}. For details about RD element values, see RD element values. |
|
extcommunity rt matches-any { rt-list-name | rt-list } |
Matches the VPN routes carrying at least one of the RTs specified in the route target set. |
rt-list-name: indicates the name of a route target set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. rt-list: indicates the route target set in the format of {element, element...}. For details about RT element values, see RT element values. |
|
extcommunity rt matches-all { rt-list-name | rt-list } |
Matches the VPN routes carrying the RTs listed in the specified route target set or more RTs. |
rt-list-name: indicates the name of a route target set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. rt-list: indicates the route target set in the format of {element, element...}. For details about RT element values, see RT element values. |
|
extcommunity rt matches-within { rt-list-name | rt-list } |
Matches the VPN routes carrying the RTs listed in the specified route target set or less RTs. |
rt-list-name: indicates the name of a route target set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. rt-list: indicates the route target set in the format of {element, element...}. For details about RT element values, see RT element values. |
|
extcommunity rt is-none |
Matches the VPN routes with an empty RT. |
- |
|
extcommunity soo matches-any { soo-list-name | soo-list } |
Matches the VPN routes carrying at least one of the site or origins (SoOs) specified in the SoO set. |
soo-list-name: indicates the name of an SoO set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. soo-list: indicates the SoO set in the format of {element, element...}. For details about SoO element values, see SoO element values. |
|
extcommunity soo matches-all { soo-list-name | soo-list } |
Matches the VPN routes carrying the SoOs listed in the specified SoO set or more SoOs. |
soo-list-name: indicates the name of an SoO set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. soo-list: indicates the SoO set in the format of {element, element...}. For details about SoO element values, see SoO element values. |
|
extcommunity soo matches-within { soo-list-name | soo-list } |
Matches the VPN routes carrying the SoOs listed in the specified SoO set or less SoOs. |
soo-list-name: indicates the name of an SoO set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. soo-list: indicates the SoO set in the format of {element, element...}. For details about SoO element values, see SoO element values. |
|
extcommunity soo is-none |
Matches the VPN routes with an empty SoO. |
- |
|
Condition Clause |
Function |
Parameters |
Commands Used to Apply Condition Clauses |
---|---|---|---|
mpls-label exist |
Matches the routes carrying MPLS labels. |
– |
|
origin is origin-type |
Matches the BGP routes carrying the specified origin-type. |
The value of origin-type can be any of the following items:
|
|
protocol is protocol-type |
Matches the routes of the specified routing protocol. |
The value of protocol-type can be any of the following items:
|
|
protocol in protocol-type |
Matches the routes of the specified routing protocol. |
The value of protocol-type can be any of the following items:
|
|
route-type is route-type |
Matches the routes of the specified type. |
The value of route-type can be any of the following items:
|
|
path-type is path-type |
Matches the BGP routes of the specified type. |
The value of path-type indicates the BGP route origin, which can be either of the following items:
|
|
rpki is rpki-type |
Matches the BGP routes with the specified origin AS validation result. |
The value of rpki-type can be any of the following items:
|
|
orf-prefix in { ip-prefix-list-name | ip-prefix-list } |
Matches the BGP routes with the outbound route filtering (ORF) prefixes in the specified IPv4 prefix set. |
ip-prefix-list-name: indicates the name of an IPv4 prefix set. The value is a string of 1 to 200 case-sensitive characters, spaces and question marks are not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. ip-prefix-list: indicates the IPv4 prefix set in the format of {element, element...}, in which the elements are IPv4 addresses carrying mask lengths. |
None |
interface in interface-list-name |
Matches the routes of which the outbound interfaces are in the specified outbound interface list. |
interface-list-name: indicates the name of an outbound interface list. The value is a string of 1 to 64 case-sensitive characters, spaces not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit. interface-list-name must have been set using the xpl interface-list section-name command. |
|