BGP Private and Public AS Range

Just like IP addresses, ASNs (Autonomous System Numbers) have to be unique on the Internet. The main reason for this is that BGP uses the AS number for its loop prevention mechanism. When BGP learns about a route that has its own AS number in its path then it will be discarded.

Here’s an example:

BGP Duplicate AS Number

Above we have three routers, R1 and R3 are using the same AS number. Once R1 sends an update, R2 will accept it but R3 will not since the AS number is the same.

To prevent the above from happening, IANA is in control of the AS numbers (similar to public IP addresses). If you want an AS number for the Internet then you’ll have to request one. They started with 16-bit AS numbers (also called 2-octet AS numbers) that were assigned like this:

  • 0: reserved.
  • 1-64.495: public AS numbers.
  • 64.496 – 64.511 – reserved to use in documentation.
  • 64.512 – 65.534 – private AS numbers.
  • 65.535 – reserved.

The 1-64.495 public AS range is pretty small so there are similar issues to the IPv4 public IP addresses, there aren’t enough numbers. Right now (May 2015) there are only 199 AS numbers left that could be assigned. You can see the current status of available AS numbers here.

To get more AS numbers, an extension has been created that supports 32-bit AS numbers (also called 4-octet AS numbers). This means we have about 4.294.967.296 AS numbers that we can use.

When you request an AS number you’ll have to justify why you need a public AS number. For some organizations, using a private AS number should also be a solution.

Private AS numbers can be used when you are connected to a single AS that uses a public AS number. Here’s an example:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 799 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

561 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Forum Replies

  1. “Removing the private AS numbers is a bit similar to NAT where we hide private IP addresses behind one or more public IP addresses”
    Accepted.
    But how are we going to do the mapping from private AS to public AS and back when the private AS number is not advertised by AS2 to AS 3 ?

  2. Hi Nikhil,

    We don’t. The only thing we do is remove the private AS number and then advertise the prefix(es). Take a look here:

    BGP Remove Private AS

    There’s no need to create a mapping between the private/public AS number.

    Rene

  3. Hey Rene,

    In your last diagram in this lesson, suppose we have many private AS behind R2 which needs to go to the Internet, in this case how will R2 handle those sessions ? We all know that in similar situation in IPv4 world we have PAT which maps the private IP with one Public IP using unique port number how does R2 handle this situation? Appreciate if you shed some light on this.

    Best,

    Sahil

  4. Hi Sahil,

    You can see it in this example:

    BGP Remove Private AS

    R2 will have the private AS paths in its own BGP table so it knows what to do.

    Rene

12 more replies! Ask a question or join the discussion by visiting our Community Forum