🗺️ BGP & Internet Routing
4 min de lectura
ASN Numbers Explained
How Autonomous System Numbers are allocated and used in internet routing.
What Is an ASN?
An ASN (Autonomous System Number) is a unique identifier assigned to an autonomous system for use in BGP routing. Every network that participates in BGP routing must have an ASN.
ASN Formats
16-bit ASNs (Original)
- Range: 1 – 65,535
- Allocated until exhaustion
- Still widely used
32-bit ASNs (Extended)
- Range: 1 – 4,294,967,295
- Introduced in RFC 6793 (2012)
- Written in "asplain" notation:
AS394354 - Required for new allocations as 16-bit ASNs are depleted
How ASNs Are Allocated
The allocation follows a hierarchical model:
# Install on Ubuntu
sudo apt install certbot python3-certbot-nginx
# Obtain certificate with Nginx plugin (automatic configuration)
sudo certbot --nginx -d example.com -d www.example.com
# Obtain certificate only (manual Nginx config)
sudo certbot certonly --nginx -d example.com
The five RIRs:
| RIR | Region | Headquarters |
|---|---|---|
| ARIN | North America | Chantilly, Virginia |
| RIPE NCC | Europe, Middle East, Central Asia | Amsterdam |
| APNIC | Asia-Pacific | Brisbane |
| LACNIC | Latin America | Montevideo |
| AFRINIC | Africa | Ebene, Mauritius |
Reserved ASN Ranges
| Range | Purpose |
|---|---|
| 0 | Reserved |
| 23456 | AS_TRANS (for 32-bit ASN transition) |
| 64496 – 64511 | Documentation and examples |
| 64512 – 65534 | Private use (not announced publicly) |
| 65535 | Reserved |
| 4200000000 – 4294967294 | Private use (32-bit) |
Private vs Public ASNs
- Public ASNs are globally unique and used for peering on the public internet
- Private ASNs (64512–65534) are used internally within organizations and stripped from BGP announcements before reaching the public internet
Looking Up ASN Information
You can look up ASN details using several methods:
# Certbot handles this automatically, or use standalone mode:
sudo certbot certonly --standalone -d example.com
# (Requires port 80 to be free)
# Or webroot mode (no port conflict):
sudo certbot certonly --webroot -w /var/www/html -d example.com
ASN lookups reveal the organization, country, registration date, and allocated IP prefixes.