A global variable set is a group of frequently used values that are defined as global variables. Global variables can be referenced by all route-filters configured on a device. This section describes how to configure global variable sets.
The data type of each value in a global variable set may vary with the route-filter that references the set.
The global variables on a device must be unique. A new global variable will override an existing global variable with the same name.
To enable a route-filter or a set to reference a global variable, enter $+variable name, for example, $globvar.
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 Configuration Procedures of Sets and Route-Filters Using the Paragraph Editing Mode. For details about XPL clauses, see XPL Paragraph Editing Clauses.
Objective | Configure a global variable set that includes two values: 100 and ip-prefix. |
Configuration Example | <HUAWEI> edit xpl global-value
xpl global-value
aaa '100',
bbb 'ip-prefix',
end-global-value
The global variable set includes a set named aaa with value 100 and another set named bbb with value ip-prefix. |
Objective | Configure a route-filter to permit only the routes with the MED value less than 100 and the routes that match the IPv4 prefix set named bbb. |
Reference Example | <HUAWEI> edit xpl ip-prefix-list r1 xpl route-filter r1 if ip med le $aaa then approve elseif ip route-destination in $bbb then approve else refuse endif end-filter The route-filter r1 uses two global variables (aaa and bbb), in which aaa represents a MED value and bbb represents an IPv4 destination address prefix set. The route-filter permits only the routes with the MED value less than 100 and the routes that match bbb. |