The apply as-path command replaces or clears the original AS_Path attribute, or adds, deletes a specified AS number to the AS_Path attribute.
The undo apply as-path command cancels the configuration.
By default, the original AS_Path attribute is not replaced or cleared and no AS number is added to or deleted from the AS_Path attribute.
Parameter | Description | Value |
---|---|---|
as-path-value |
Specifies an AS number. |
The value is an integer ranging from 1 to 4294967295 or the value is in the format of x.y, in which x and y are integers ranging from 1 to 65535 and from 0 to 65535, respectively. |
additive |
Adds the specified AS number to the original AS_Path attribute. |
- |
overwrite |
Replaces the AS numbers in the original AS_Path attribute. |
- |
delete |
Deletes the specified AS number from the original AS_Path attribute. |
- |
Usage Scenario
The AS_Path attribute is a private attribute of BGP used to record all ASs that a route passes through from the local area to the destination in distance-vector (DV) order. The AS_Path attribute can be used to control route selection and prevent routing loops. When the filtering conditions specified by if-match clauses are met and the matching mode is set to permit, you can use the apply as-path command to set the AS_Path attributes of the routes that match the filtering conditions.
Prerequisites
A route-policy has been configured using the route-policy command.
Configuration Impact
After the apply as-path command is configured, the AS_Path attributes of the BGP routes that match filtering conditions are changed. For example, the original AS_Path attribute is (30, 40, 50). If the filtering conditions are met and the apply as-path 60 70 80 10.10 additive command is run, the original AS_Path attribute is changed to (60, 70, 80, 10.10, 30, 40, 50). If the apply as-path overwrite command is configured for an export policy and the export policy is applied to an EBGP peer, the local device replaces only non-local AS numbers in the original AS_Path attribute. If the apply as-path none overwrite command is configured for an export policy and the export policy is applied to an EBGP peer, the local device deletes only non-local AS numbers from the original AS_Path attribute. Such implementation does not apply to IBGP peers. For example, if the apply as-path 60 70 80 10.10 overwrite command is run for an export policy and the export policy is applied to an IBGP peer, the original AS_Path attribute is changed to (60, 70, 80, 10.10). If the apply as-path none overwrite command is run for an export policy and the export policy is applied to an IBGP peer, the original AS_Path attribute is changed to null.
After the apply as-path command is run, the configuration is backed up to the slave main control board. You can run the display route-policy command to check whether the configuration takes effect.Precautions
Running the apply as-path command changes the path through which network traffic passes. Use this command only when you are familiar with the network topology and impact of the command on services.
The apply as-path and apply as-path (enhance) commands function the same except the following: The apply as-path command can be used to configure a maximum of 128 AS numbers, whereas the apply as-path (enhance) command can be used to configure 129 to 256 AS numbers.