Actions That Manipulate Route Characteristics
You can specify one or more of the actions listed in Table 14 to manipulate route characteristics.
(BGP only) Affix one or more AS numbers at the beginning of the AS path. If specifying more than one AS number, include the numbers in quotation marks. The AS numbers are added after the local AS number has been added to the path. This action adds AS numbers to AS sequences only, not to AS sets. If the existing AS path begins with a confederation sequence or set, the affixed AS numbers are placed within a confederation sequence. Otherwise, the affixed AS numbers are placed with a nonconfederation sequence. For more information, see Configuring the AS Path Prepend Action.
(BGP only) Extract the last AS number in the existing AS path and affix that AS number to the beginning of the AS path
ntimes, wherenis a number from 1 through 32. The AS number is added before the local AS number has been added to the path. This action adds AS numbers to AS sequences only, not to AS sets. If the existing AS path begins with a confederation sequence or set, the affixed AS numbers are placed within a confederation sequence. Otherwise, the affixed AS numbers are placed within a nonconfederation sequence. This option is typically used in non-IBGP export policies.(Class of service [CoS] only) Apply the specified class-of-service parameters to routes installed into the routing table. For more information, see the JUNOS Network Interfaces Configuration Guide.
Set the preference value to the specified value. The
colorandcolor2preference values are even more fine-grained than those specified in thepreferenceandpreference2actions. The color value can be a number in the range from 0 through 4,294,967,295 (232 -1). A lower number indicates a more preferred route.If you set the preference with the
coloraction, the value is internal to the JUNOS software and is not transitive.For more information about preference values, see the JUNOS Routing Protocols Configuration Guide.
Change the color preference value by the specified amount. If an addition operation results in a value that is greater than 4,294,967,295 (232 -1), the value is set to 232 -1. If a subtraction operation results in a value less than 0, the value is set to 0. If an attribute value is not already set at the time of the addition or subtraction operation, the attribute value defaults to a value of 0 regardless of the amount specified. If you perform an addition to an attribute with a value of 0, the number you add becomes the resulting attribute value.
(BGP only) Add the specified communities to the set of communities in the route. For more information, see Configuring Communities.
(BGP only) Delete the specified communities from the set of communities in the route. For more information, see Configuring Communities.
(BGP only) Replace any communities that were in the route in with the specified communities. For more information, see Configuring Communities.
(BGP only) Apply the specified route-damping parameters to the route. These parameters override the default damping parameters. This action is useful only in an import policy, because the damping parameters affect the state of routes in the routing table.
To apply damping parameters, you must enable BGP flap damping as described in the JUNOS Routing Protocols Configuration Guide, and you must create a named list of parameters as described in Configuring the Damping Action.
Maintain packet counts for a route passing through your network, based on the destination address in the packet. You can do the following:
- Configure group destination prefixes by configuring a routing policy; see Defining Routing Policies and Examples: Routing Policy Configuration.
- Apply that routing policy to the forwarding table with the corresponding destination class; see Applying Routing Policies to the Forwarding Table. For more information about the
forwarding-tableconfiguration statement, see the JUNOS Routing Protocols Configuration Guide.- Enable packet counting on one or more interfaces by including the
destination-class-usagestatement at the [edit interfacesinterface-nameunitlogical-unit-numberfamily inet accounting] hierarchy level (see the JUNOS Class of Service Configuration Guide). See Examples: Routing Policy Configuration.- View the output by using one of the following commands:
show interfacesinterface-namedestination-classdestination-class-name,show interfacesinterface-nameextensive,orshow interfacesinterface-namestatistics(see the JUNOS Network and Services Interfaces Command Reference).To configure a packet count based on the source address, use the
source-classstatement described in this table.
metric multiplier <x> offset <a>Calculate a metric based on the current values of
metricandmetric2.This policy action overrides the current value of the metric attribute with the result of the following expression:
((x * metric) + a) + ((y * metric2) + b)
where
metricandmetric2are the current input values. Metric multipliers are limited in range to eight significant digits.Set the external metric type for routes exported by OSPF. You must specify the keyword
type.Create the forwarding-class which includes packets based on both the destination address and the source address in the packet. You can do the following:
- Configure group prefixes by configuring a routing policy; see Defining Routing Policies and Examples: Routing Policy Configuration.
- Apply that routing policy to the forwarding table with the corresponding forwarding class; see Applying Routing Policies to the Forwarding Table. For more information about the
forwarding-tableconfiguration statement, see the JUNOS Routing Protocols Configuration Guide.- Enable packet counting on one or more interfaces by using the procedure described in either the
destination-classorsource-classactions defined in this table.Choose which next hops, among a set of equal LSP next hops, are installed in the forwarding table. Use the export policy for the forwarding table to specify the LSP next hop to be used for the desired routes. Specify the
strictoption to enable strict mode, which checks to see if any of the LSP next hops specified in the policy are up. If none of the specified LSP next hops are up, the policy installs the discard next hop.(For export to the forwarding table only) Install all next-hop addresses in the forwarding table and have the forwarding table perform per-packet load balancing. This policy action allows you to optimize VPLS traffic flows across multiple paths. For more information, see Configuring the Load-Balance Per-Packet Action.
(BGP only) Set the BGP local preference (
LOCAL_PREF) attribute. The preference value can be a number in the range from 0 through 4,294,967,295 (232 -1).Change the local preference value by the specified amount. If an addition operation results in a value that is greater than 4,294,967,295 (232 - 1), the value is set to 232 - 1. If a subtraction operation results in a value less than 0, the value is set to 0. If an attribute value is not already set at the time of the addition or subtraction operation, the attribute value defaults to a value of 0 regardless of the amount specified. If you perform an addition to an attribute with a value of 0, the number you add becomes the resulting attribute value.
For BGP, if the attribute value is not known, it is initialized to 100 before the routing policy is applied.
Set the metric. You can specify up to four metric values, starting with
metric(for the first metric value) and continuing withmetric2,metric3, andmetric4.(BGP only)
metriccorresponds to the MED, andmetric2corresponds to the IGP metric if the BGP next hop loops through another router.
metric(add | subtract)numbermetric2(add | subtract)numbermetric3(add | subtract)numbermetric4(add | subtract)numberChange the metric value by the specified amount. If an addition operation results in a value that is greater than 4,294,967,295 (232 - 1), the value is set to 232 - 1. If a subtraction operation results in a value less than 0, the value is set to 0. If an attribute value is not already set at the time of the addition or subtraction operation, the attribute value defaults to a value of 0 regardless of the amount specified. If you perform an addition to an attribute with a value of 0, the number you add becomes the resulting attribute value.
(BGP only) Change the metric (MED) value by the specified negative or positive offset. This action is useful only in an external BGP (EBGP) export policy.
next-hop (address|discard | next-table | peer-address | reject | self)Set the next hop. When the advertising protocol is BGP, you can set the next hop only when any third-party next hop can be advertised; that is, when using IBGP or EBGP confederations.
If you specify
self, the next-hop address is replaced by one of the local router's addresses. The advertising protocol determines which address to use. When the advertising protocol is BGP, this address is set to the local IP address used for the BGP adjacency. A router cannot install routes with itself as the next hop.If you specify
peer-address, the next-hop address is replaced by the peer's IP address. This option is valid only in import policies. Primarily used by BGP to enforce using the peer's IP address for advertised routes, this option is meaningful only when the next hop is the advertising router or another directly connected router.If you specify
discard, the next-hop address is replaced by a discard next-hop.If you specify
next-table, the router performs a forwarding lookup in the specified table.If you specify
reject, the next-hop address is replaced by a reject next hop.(BGP only) Set the BGP origin attribute to one of the following values:
Set the preference value. You can specify a primary preference value (
preference) and a secondary preference value (preference2). The preference value can be a number in the range from 0 through 4,294,967,295 (232 - 1). A lower number indicates a more preferred route.To specify even finer-grained preference values, see the
colorandcolor2actions in this table.If you set the preference with the
preferenceaction, the new preference remains associated with the route. The new preference is internal to the JUNOS software and is not transitive.For more information about preference values, see the JUNOS Routing Protocols Configuration Guide.
preference(add | subtract)numberpreference2(add | subtract)numberChange the preference value by the specified amount. If an addition operation results in a value that is greater than 4,294,967,295 (232 - 1), the value is set to 232 - 1. If a subtraction operation results in a value less than 0, the value is set to 0. If an attribute value is not already set at the time of the addition or subtraction operation, the attribute value defaults to a value of 0 regardless of the amount specified. If you perform an addition to an attribute with a value of 0, the number you add becomes the resulting attribute value.
Maintain packet counts for a route passing through your network, based on the source address. You can do the following:
- Configure group source prefixes by configuring a routing policy; see Defining Routing Policies and Examples: Routing Policy Configuration.
- Apply that routing policy to the forwarding table with the corresponding source class; see Applying Routing Policies to the Forwarding Table. For more information about the
forwarding-tableconfiguration statement, see the JUNOS Routing Protocols Configuration Guide.- Enable packet counting on one or more interfaces by including the
source-class-usagestatement at the [edit interfacesinterface-nameunitlogical-unit-numberfamily inet accounting] hierarchy level (see the JUNOS Network Interfaces Configuration Guide). Also, follow thesource-class-usagestatement with theinputoroutputstatement to define the inbound and outbound interfaces on which traffic monitored for source-class usage (SCU) is arriving and departing (or define one interface for both). The complete syntax is[edit interfacesinterface-nameunitunit-numberfamily inet accounting source-class-usage (input | output | input output). See the example in Examples: Routing Policy Configuration.- View the output by using one of the following commands:
show interfacesinterface-namesource-classsource-class-name,show interfacesinterface-nameextensive,orshow interfacesinterface-namestatistics(see the JUNOS Network and Services Interfaces Command Reference).To configure a packet count based on the destination address, use the
destination-classstatement described in this table.For a detailed source-class usage example configuration, see the JUNOS Feature Guide.
Set the tag value. You can specify two tag strings:
tag(for the first string) andtag2. These values are local to the router.(For OSPF and IS-IS only) The
tagandtag2actions set the 32-bit tag field in OSPF external link-state advertisement (LSA) packets, and the 32-bit flag in the IS-IS IP prefix type length values (TLV).Change the tag value by the specified amount. If an addition operation results in a value that is greater than 4,294,967,295 (232 -1), the value is set to 232 -1. If a subtraction operation results in a value less than 0, the value is set to 0. If an attribute value is not already set at the time of the addition or subtraction operation, the attribute value defaults to a value of 0 regardless of the amount specified. If you perform an addition to an attribute with a value of 0, the number you add becomes the resulting attribute value.