What is ASN?
Autonomous System Number
An ASN (Autonomous System Number) is the unique number that identifies an autonomous system, a network with its own routing policy, in BGP.
Every BGP router is configured with its own ASN and the ASN it expects each neighbour to have; if the number in a neighbour's OPEN message doesn't match, the session doesn't come up. ASNs were originally 16-bit (0–65535). That pool ran short, so RFC 6793 extended them to 32 bits, and modern routers negotiate 4-byte ASN support when the session opens. A few ranges are worth knowing:
- 64496–64511 and 65536–65551 are reserved for documentation and examples.
- 64512–65534 and 4200000000–4294967294 are private, like RFC 1918 addresses: fine inside your own network, never on the public internet.
- 0, 65535 and 4294967295 are reserved.
Public ASNs are assigned by a Regional Internet Registry, usually to an organisation that connects to more than one provider and needs its own routing policy. A customer with a single upstream can often use a private ASN, which the provider removes before passing routes on. Each time a route crosses an AS boundary, the sender's ASN is added to the route's AS_PATH, which is how BGP detects loops and measures distance. A common confusion is between the AS (the network) and the ASN (its number); in conversation the two are used almost interchangeably, but see AS for the network itself. Large 32-bit ASNs are normally written as a plain number (asplain), although some older documentation uses a dotted "asdot" form. The BGP Fundamentals lesson walks through the ranges and how ASNs appear in sessions and paths.
Lessons that use ASN
- BGP FundamentalsTeaches this term · Intermediate · 75 min
How the Border Gateway Protocol glues the internet together: autonomous systems, sessions, path attributes, best-path selection, iBGP scaling and a hands-on eBGP lab with real FRR configuration.
- IRR, RPSL and AS-SETsIntermediate · 60 min
How networks publish what they announce and how their neighbours turn it into filters: Internet Routing Registries, whois queries, RPSL objects and attributes, AS-SET expansion, bgpq4, and the pitfalls of unsigned routing data.
- BGP communities, prepending and RTBHIntermediate · 45 min
Tag routes with large communities, steer inbound traffic with AS-path prepending (and see why providers' local preference limits it), and stop a DDoS at your provider's edge with remotely triggered blackholing. Built on VyOS with two transit providers, including the two RTBH mistakes the lab made first.
- RPKI and Route Origin ValidationIntermediate · 70 min
Cryptographically signed routing origins: the RPKI trust chain, creating safe ROAs, Valid/Invalid/NotFound, validators and RTR, a real FRR + StayRTR lab, and what ROV can't stop (forged origins, leaks), plus where ASPA comes in.
- Setting up VyOS with basic BGPIntermediate · 50 min
Build a VyOS edge router from scratch: one upstream transit provider, one Internet Exchange route server, and the import and export policy that keeps both safe. Every command and output comes from a real VyOS lab.