Is it possible to have multiple AS number in the same router?

Example: Routing-Instance A for AS100 and Routing-Instance B for AS200 ?

Please share me some example or configuration.

  • It really depends on the solution you are looking for. Are you trying to keep seperate L3 routing domains, such as with VRFs? Or are you saying you have two instances of the same routing protocol (ex. BGP, you have AS 1 and 2 on the same L3 router) and are trying to distribute routes between those two networks? In both of those cases, yes, but it depends on your solution.
    – Nerd_Buff
    Aug 23, 2018 at 0:59
  • @Nerd_Buff Actually I would like to have 2 instances of the same routing protocol on the same router and both instances can connect to each other by eBGP. Example : Internet <--> Router A (AS100) <--eBGP--> Router A (AS200) Aug 23, 2018 at 6:16
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 25, 2018 at 9:21

2 Answers 2


Sort of.

You can have an AS number configured globally for the router and a local AS defined for a specific peer.

From Juniper documentaion page Examples: Configuring BGP Local AS:


Use the local-as statement when ISPs merge and want to preserve a customer’s configuration, particularly the AS with which the customer is configured to establish a peer relationship. The local-as statement simulates the AS number already in place in customer routers, even if the ISP’s router has moved to a different AS.

This example shows how to use the local-as statement to configure a local AS. The local-as statement is supported for BGP at the global, group, and neighbor hierarchy levels.

When you configure the local-as statement, you must specify an AS number. You can specify a number from 1 through 4,294,967,295 in plain-number format. In Junos OS Release 9.1 and later, the range for AS numbers is extended to provide BGP support for 4-byte AS numbers as defined in RFC 4893, BGP Support for Four-octet AS Number Space. In Junos OS Release 9.3 and later, you can also configure a 4-byte AS number using the AS-dot notation format of two integer values joined by a period: <16-bit high-order value in decimal>.<16-bit low-order value in decimal>. For example, the 4-byte AS number of 65,546 in plain-number format is represented as 1.10 in the AS-dot notation format. You can specify a value from 0.0 through 65535.65535 in AS-dot notation format. Junos OS continues to support 2-byte AS numbers. The 2-byte AS number range is 1 through 65,535 (this is a subset of the 4-byte range).

set interfaces fe-1/2/0 unit 2 family inet address  
set interfaces fe-1/2/1 unit 3 family inet address  
set interfaces lo0 unit 2 family inet address  
set protocols bgp group ext type external  
set protocols bgp group ext export send-direct  
set protocols bgp group ext export send-static  
set protocols bgp group ext local-as 250  
set protocols bgp group ext neighbor peer-as 100  
set protocols bgp group ext neighbor peer-as 300  
set policy-options policy-statement send-direct term 1 from protocol direct  
set policy-options policy-statement send-direct term 1 then accept  
set policy-options policy-statement send-static term 1 from protocol static  
set policy-options policy-statement send-static term 1 then accept  
set routing-options autonomous-system 200 
  • 1
    "Sort of" is right. That's a special use-case and isn't really the same as having two separate routing instances on the same router.
    – Jesse P.
    Aug 22, 2018 at 12:21
  • For example : In case of, ISP-A acquires network of ISP-B. If Each ISP have their own ISP-Router and used their own AS Number,IGP Routing and MPLS. From the following BGP local AS, I have some questions. 1. Both two ASN in the same router are using the same global BGP configuration. How can each ISP configure their own BGP policy ? 2. What is the routing protocol run for the connecton of ISP-A and ISP-B in the same router ? Aug 23, 2018 at 6:42

There are multiple ways to achieve this.

You have the Local AS feature which gives you the ability to change your AS in regards to another eBGP peer. You could also run a second routing daemon by using logical systems. Also a quite new feature is to have completely separate, virtual REs for specific linecards on Juniper MX. This feature is called node slicing.

Judging by your comment I think the best way to achieve what you want is to use logical systems. You connect the logical systems by using lt interfaces.

  • Neither of those are really answering the question. Local-AS is not running multiple routing instances on the same router - they're effectively the same instance with two ASNs and share a single route table. Logical systems (aka contexts) would work to break apart the routing table and allow for multiple routing instances but would also break apart everything else and behave like completely separate routers, which isn't really how the original question was worded and I'm guessing it wouldn't be desirable in this case (technically it would work, though).
    – Jesse P.
    Aug 23, 2018 at 11:25
  • 1
    Jesse, there is JUNIPER tag under the question Aug 24, 2018 at 8:51
  • @JesseP. These are the options you have on a Juniper box. If you have a better solution for the poster by all means post an answer. Sep 3, 2018 at 15:00
  • @Sebastian I did. I removed it a couple days later.
    – Jesse P.
    Sep 3, 2018 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.