Course contents

Module 5: Scaling and OperationsLesson 5.6 (6 of 7 in this module)36 of 43 in the BGP course

Private and 4-byte AS numbers

AS numbers are a limited resource, and not every network has a public one. This lesson covers what the ranges mean, how 4-byte numbers are written, and how a private AS is kept off the internet.

Advanced · 12 min read

You'll learn to identify private and documentation AS ranges, read asplain and asdot numbers, explain AS_TRANS, and use remove-private-as.

AS number ranges

An autonomous system number identifies a network that follows one routing policy. Numbers come in ranges with different uses.

AS number ranges
AS number rangesNine rows of AS number ranges: reserved values, public 2-byte, AS_TRANS 23456, documentation 64496 to 64511, private 64512 to 65534, 4-byte documentation, an IANA-reserved block, public 4-byte and 4-byte private.0, 65535, 4294967295Reserved1 to 64495Public 2-byte AS numbers (RIRs assign these)23456AS_TRANS: placeholder for 2-byte-only peers64496 to 64511Documentation (RFC 5398), used in this course64512 to 65534Private (RFC 6996)65536 to 655514-byte documentation (RFC 5398)65552 to 131071Reserved by IANA131072 to 4199999999Public 4-byte AS numbers4200000000 to 42949672944-byte private (RFC 6996)

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Not to scale. This course uses the documentation range, so remove-private-as does not change its example AS numbers.
AS number ranges
AS number rangesRange; Use. 64496 to 64511: Documentation and examples (RFC 5398). Used throughout this course. 64512 to 65534: Private use, 16-bit (RFC 6996) 4200000000 to 4294967294: Private use, 32-bit (RFC 6996) 23456: AS_TRANS, the 4-byte placeholderRangeUse64496 to 64511Documentation and examples (RFC 5398). Used throughout this course.64512 to 65534Private use, 16-bit (RFC 6996)4200000000 to 4294967294Private use, 32-bit (RFC 6996)23456AS_TRANS, the 4-byte placeholder

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each item on the left, with what it means on the right.

Writing 4-byte numbers

Two notations exist. Asplain writes the number as one decimal, such as 196613. Asdot writes high and low halves, 3.5, for the same value. Cisco IOS XE shows asplain by default; bgp asnotation dot switches the display. The value on the wire does not change.

Two ways to write a 4-byte AS
Two ways to write a 4-byte ASThe same number can be written as one decimal or as two parts.asplain 65546One decimal number (default on Cisco IOS XE)asdot 1.10High part dot low part (65536 x 1 + 10)

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Check which notation a device expects before typing.
router bgp 4200000001 bgp router-id 1.1.1.1

A router using a 32-bit private AS in asplain form. Both neighbours must support the 4-byte capability, or the path shows AS_TRANS to old routers.

A private AS number removed at the edge
A private AS number removed at the edgeA customer router in private AS 65010 peers with R1 in AS 64500. R1 passes the route to the provider in AS 64501. Because 65010 is a private AS number, R1 is configured with remove-private-as so the path the provider sees is 64500 only. Private numbers must not appear on the public internet.CEAS 65010 (private)R1AS 64500ISPAS 64501Inside R1AS path 65010What the provider seesAS path 64500neighbor 192.0.2.1 remove-private-as

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Private ranges are 64512 to 65534 and 4200000000 to 4294967294. remove-private-as is applied towards the public neighbour, on the outbound side.

Hiding a private AS from the internet

A customer may use a private AS toward its provider. The provider must not advertise that private number to the world. remove-private-as strips private numbers from the AS_PATH on routes sent to a neighbour.

remove-private-as: what the ISP sees in the AS_PATH
remove-private-as: what the ISP sees in the AS_PATHA branch router in private AS 65010 connects to R1 in AS 64500, which connects to ISP A. Without remove-private-as ISP A sees AS_PATH 64500 65010. With it, R1 strips the private AS and ISP A sees only 64500.Branch routerAS 65010 (private)R1AS 64500ISP AAS 64501AS_PATH: 65010default: 64500 65010remove-private-as: 64500remove-private-as strips private AS numbers from pathssent to an eBGP neighbour. R1 still adds its own AS,so ISP A sees AS_PATH 64500.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

R1 removes the private AS number, then adds its own, so the ISP never sees a number it cannot verify.
router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 remove-private-as all replace-as

Applied on the router that sends to the public peer. all removes every private AS in the path; replace-as puts the local AS in their place so the path length stays the same.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
ISP#show ip bgp 198.51.100.0
BGP routing table entry for 198.51.100.0/24, version 3
Paths: (1 available, best #1, table default)
  64501 64501
    192.0.2.6 from 192.0.2.6 (12.12.12.12)
      Origin IGP, metric 0, localpref 100, valid, external, best
The private AS is gone and replaced by the sender's own number, so remote networks see a normal public AS path. Without replace-as the path is shorter, which can change the route's preference.

Technical references: RFC 6793 (4-byte AS) and RFC 6996 (private AS ranges). Output above is illustrative.

Check your understanding

Predict · scenario 1

Which AS number is a documentation value and not for real use?

Predict · scenario 2

An old router sees AS 23456 in a path. What is it?

Predict · scenario 3

What does replace-as add to remove-private-as all?

FAQ

Why did AS numbers grow to 32 bits?
The 16-bit space has 65,535 values and many are taken. RFC 6793 extended the AS number to 32 bits, about 4.29 billion values, and the BGP capability tells neighbours which routers understand it.
What is AS_TRANS?
AS 23456 is a placeholder. A router that cannot read 4-byte numbers sees AS_TRANS in its place, and the real numbers travel in the optional AS4_PATH attribute.
Are the lab AS numbers real?
No. Course AS numbers 64500 to 64511 are the documentation range, reserved for examples.