A route-filter can use its condition clause to filter routes and use its action clause to set or modify route attributes of the routes that match the condition clause. This section describes how to configure route-filters.
If only paragraph editing is used as an example, the corresponding line editing is similar. To use the line editing mode, perform the operations described in paragraph editing.
For detailed set and route-filter configuration steps, see Set and Route-Filter Configuration Steps. For details about XPL clauses, see XPL Paragraph Editing Clauses.
Objective |
Configure a route-filter to set the priorities of the BGP routes destined for 1.1.1.1 to 200. |
Configuration Example 1 |
<HUAWEI> edit xpl route-filter r1
xpl route-filter r1
if ip route-destination in { 1.1.1.1 32 } then
apply preference 200
endif
end-filter
The IPv4 prefix set used by the preceding route-filter includes only one element. In this situation, use the format of {element A, element B...} to present the IPv4 prefix set. |
Objective |
Create a route-filter named para with a pre-defined variable and configure another route-filter named r2 to reference para. |
Configuration Example 2 |
<HUAWEI> edit xpl route-filter para xpl route-filter para($var) apply med $var end-filter <HUAWEI> edit xpl route-filter r2 xpl route-filter r2 if ip route-destination in aaa then call route-filter para(20) elseif ip route-destination in bbb then call route-filter para(30) endif end-filter aaa and bbb specified in r2 are IPv4 prefix sets, and a maximum of eight parameters can be referenced by each route-filter. |
Objective |
Configure a route-filter to set the priorities of the BGP routes carrying destination IP address 1.1.1.1 and MPLS labels to 50. |
Configuration Example 3 |
<HUAWEI> edit xpl route-filter r3
xpl route-filter r3
if ip route-destination in { 1.1.1.1 32 } and mpls-label exist then
apply preference 50
endif
end-filter
The conditions in a condition clause can be connected with the Boolean operator NOT, AND, or OR. |
After configuring route-filters, check the configurations.
Run the display xpl route-filter [ name xpl-name { attachpoints | uses | detail } ] command to check the XPL route-filter configurations or the detailed information referenced by routing protocols.
Run the display xpl route-filter state [ attached | unattached ] command to check information about XPL route-filter configurations and references.
Run the display xpl statistics command to check XPL line and route-filter specifications and current statistics.