IPv6 prefix sets apply to all dynamic routing protocols and can be used to match source, destination, and next hop IPv6 addresses. This section describes how to configure IPv6 prefix sets.
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 an IPv6 prefix set to match the routes in network segments 2001:db8:0:1::/64, 2001:db8:1:1::/64, and 2001:db8:1:2::/64. |
Configuration Example 1 | <HUAWEI> edit xpl ipv6-prefix-list aaa
xpl ipv6-prefix-list aaa
2001:db8:0:1:: 64,
2001:db8:1:1:: 64,
2001:db8:1:2:: 64
end-list
The IPv6 prefix set aaa includes three elements and matches the routes in network segments 2001:db8:0:1::/64, 2001:db8:1:1::/64, and 2001:db8:1:2::/64. |
Objective | Configure an IPv6 prefix set to match the routes in network segment 2001:db8:0:1::/64 with the mask length ranging from 96 to 100 bits, the routes in network segment 2001:db8:1:1::/64 with the mask length greater than or equal to 100 bits, and the routes in network segment 2001:db8:1:2::/64 with the mask length of 96 bits. |
Configuration Example 2 | <HUAWEI> edit xpl ipv6-prefix-list aaa
xpl ipv6-prefix-list aaa
2001:db8:0:1:: 64 ge 96 le 100,
2001:db8:1:1:: 64 le 100,
2001:db8:1:2:: 64 eq 96
end-list
The IPv6 prefix set bbb includes three elements and matches the routes in network segment 2001:db8:0:1::/64 with the mask length ranging from 96 to 100 bits, the routes in network segment 2001:db8:1:1::/64 with the mask length greater than or equal to 100 bits, and the routes in network segment 2001:db8:1:2::/64 with the mask length of 96 bits. |
Objective | Configure a route-filter to deny the routes that match IPv6 prefix set bbb and the routes that match neither IPv6 prefix set aaa nor bbb and permit the routes that do not match bbb but match aaa and increase their MED values by 10. |
Reference Example | <HUAWEI> edit xpl route-filter r1 xpl route-filter r1 if ip route-destination in bbb then refuse elseif ip route-destination in aaa then apply med + 10 else refuse endif end-filter The route-filter r1 references two IPv6 destination address prefix sets (aaa and bbb), denies the routes that match IPv6 destination address prefix set bbb, permits the routes that do not match bbb but match aaa and increases their MED values by 10, and denies all other routes. |