Defining Prefix Lists
You can create a named prefix list and include it in a routing policy with the
prefix-listmatch condition (described in Table 12).To define a prefix list, include the
prefix-liststatement:prefix-listprefix-list-name{ apply-path path;ip-addresses;}You can include this statement at the following hierarchy levels:
You can use the
apply-pathstatement 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-listmatch condition in thefromstatement at the[edit policy-options policy-statementpolicy-nametermterm-name]hierarchy level:[editpolicy-options policy-statementpolicy-nametermterm-name]from {prefix-listprefix-list-name;}thenactions;
nameidentifies 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 (double quotes).
ip-addressesare the IPv4 or IP version 6 (IPv6) prefixes specified asprefix/prefix-length. If you omitprefix-lengthfor an IPv4 prefix, the default is/32. If you omitprefix-lengthfor an IPv6 prefix, the default is/128. Prefixes specified in afromstatement 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
fromstatement of multiple routing policies or firewall filters. For information about firewall filters, see Firewall Filters.Use the
apply-pathstatement to configure a prefix list comprising of 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-pathto define a prefix list, the prefix list can be used in a firewall filter only. It cannot be used 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.