Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?




Hierarchy Level


When advertising AS paths to remote systems, have the local system strip private AS numbers from the AS path. The numbers are stripped from the AS path starting at the left end of the AS path (the end where AS paths have been most recently added). The routing device stops searching for private ASs when it finds the first nonprivate AS or a peer’s private AS. If the AS path contains the AS number of the external BGP (EBGP) neighbor, BGP does not remove the private AS number.


As of Junos OS 10.0R2 and higher, if there is a need to send prefixes to an EBGP peer that has an AS number that matches an AS number in the AS path, consider using the as-override statement instead of the remove-private statement.

The operation takes place after any confederation member ASs have already been removed from the AS path, if applicable.

Junos OS recognizes the set of AS numbers that is considered private, a range that is defined in the Internet Assigned Numbers Authority (IANA) assigned numbers document.

The set of reserved AS numbers is in the range from 64,512 through 65,535. The 32-bit private ASN scope is in the range from 4,200,000,000 through 4,294,967,294.



Remove all private AS numbers from the original path. Do not stop the process of removing private AS numbers, even if a public AS number is encountered.


When you use the all and replace options, choose the last (right-most) public AS number encountered in the original AS path for the replacement value, as the AS path is processed from left to right. If no public AS number is encountered, the default replacement value is used. (See the replace option for information about the default replacement value.)


When you use the all option, instead of a removing private AS numbers, perform a replace operation. The default replacement value for the private AS number is the local AS number at the BGP group level for the BGP peer. If you are unsure about the replacement value, check the local AS value displayed in the output of the show bgp group group-name command.


Peer loop check is removed. By default, the remove-private statement has a peer loop check restriction. If a private AS in the AS path has the same value as the configured peer-as for the neighbor, remove-private does not remove or replace this private AS number. This restriction provides peer-as loop protection. However, you can remove this restriction using the no-peer-loop-check option.

Required Privilege Level

routing—To view this statement in the configuration.

routing-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.

no-peer-loop-check option added in Junos OS Release 15.1.