You can include the local-as statement to configure a router to use a different AS number than the one for which the router is configured. The local AS is used in all BGP protocol exchanges with the routers that are configured for simulating a virtual AS.
![]() |
Note: If you configure the local AS values for any BGP group, the detection of routing loops is performed using both the AS and the local AS values for all BGP groups. |
Use the local-as statement when ISPs merge and want to preserve a customer’s configuration, particularly the AS the customer is configured to peer with. Use the local-as statement to simulate the AS number already in place in customer routers, even if the ISP’s router is in a different AS now.
Figure 10: Local AS Configuration

In Figure 10, Router 1 and Router 2 are in AS 65500, Router 4 is in AS 64513, and Router 3 is in AS 64512. Router 2 uses AS 65001 as its local AS.
Router 2 adds AS 65001 when announcing Router 1’s routes to Router 3. Router 3 sees an AS path of 65001 65500 64512 for the prefix 10/8. To prevent Router 2 from adding the virtual AS number in its announcements to other peers, use the local-as autonomous-system private statement. The local-as autonomous-system private statement configures Router 2 to not include the virtual AS number configured in local-as when announcing Router 1’s routes to Router 3. In this case, Router 3 sees an AS path of 65500 64512 for the prefix 10/8.
The configuration for each router follows.
-
On Router 1:
- routing-options {
- autonomous-system 65500;
- }
- protocols {
-
- bgp {
-
- group internal-AS65500 {
- type internal;
- local-address 10.1.1.1;
- neighbor 10.1.1.2;
- }
- }
- }
-
On Router 2:
- routing-options {
- autonomous-system 65500;
- }
- protocols {
-
- bgp {
-
- group internal-AS65500 {
- type internal;
- local-address 10.1.1.2;
- neighbor 10.1.1.1;
- }
-
- group external-AS64513 {
- type external;
- peer-as 64513;
- neighbor 192.168.1.2;
- }
-
- group external-AS64512 {
- type external;
- peer-as 64512;
- neighbor 192.168.10.2;
- }
- }
- }
-
On Router 3:
- routing-options {
- autonomous-system 64512;
- }
- protocols {
-
- bgp {
-
- group external-AS65001 {
- type external;
- peer-as 65001;
- neighbor 192.168.10.1;
- }
- }
- }
-
On Router 4:
- routing-options {
- autonomous-system 64513;
- }
- protocols {
-
- bgp {
-
- group external-65500 {
- peer-as 65500;
- neighbor 192.168.1.1;
- }
- }
- }