You can create a named prefix list and include it in a routing policy with the prefix-list match condition (described in Table 14).
To define a prefix list, include the prefix-list statement:
-
prefix-list prefix-list-name {
- apply-path path;
-
ip-addresses;
- }
You can include this statement at the following hierarchy levels:
You can use the apply-path statement to include all prefixes pointed to by a defined path, or you can specify one or more addresses, or both.
To include a prefix list in a routing policy, specify the prefix-list match condition in the from statement at the [edit policy-options policy-statement policy-name term term-name] hierarchy level:
- [edit policy-options policy-statement policy-name term term-name]
- from {
-
prefix-list prefix-list-name;
- }
- then actions;
name identifies the prefix list. It can contain letters, numbers, and hyphens (-) and can be up to 255 characters long. To include spaces in the name, enclose the entire name in quotation marks (“ ”).
ip-addresses are the IPv4 or IP version 6 (IPv6) prefixes specified as prefix/prefix-length. If you omit prefix-length for an IPv4 prefix, the default is /32. If you omit prefix-length for an IPv6 prefix, the default is /128. Prefixes specified in a from statement must be either all IPv4 addresses or all IPv6 addresses.
![]() |
Note: You cannot apply actions to individual prefixes in the list. |
You can specify the same prefix list in the from statement of multiple routing policies or firewall filters. For information about firewall filters, see Configuring Firewall Filters.
Use the apply-path statement to configure a prefix list comprising all IP prefixes pointed to by a defined path. This eliminates most of the effort required to maintain a group prefix list.
The path consists of elements separated by spaces. Each element matches a configuration keyword or an identifier, and you can use wildcards to match more than one identifier. Wildcards must be enclosed in angle brackets, for example, <*>.
![]() |
Note: When you use apply-path to define a prefix list, you can also use the same prefix list in a policy statement. |
For examples of configuring a prefix list, see Example: Configuring a Prefix List; for examples of configuring a firewall filter, see Configuring Firewall Filters.