How to get your own IP addresses (PI, ASN, BGP) — article mark

How to get your own IP addresses (PI, ASN, BGP)

Networking

To get IP addresses that are yours, you register a block with a Regional Internet Registry, get an AS number, and announce the block to the internet over BGP. The block is either Provider-Independent (PI) space requested through a sponsoring registry member, or the allocation you receive by becoming a member (a Local Internet Registry, LIR) yourself. The smallest block the internet will route is a /24 of IPv4 (256 addresses) or a /48 of IPv6. The address your ISP hands you is none of this: it sits in the ISP’s block, is announced by the ISP’s routers, and stays behind when you leave.

The whole procedure, in order:

  1. Pick your registry by region: RIPE NCC, ARIN, APNIC, LACNIC or AFRINIC.
  2. Get the block. IPv6: request a /48 of PI through a sponsoring LIR, or join as an LIR. IPv4: buy a /24 on the transfer market (about $20–35 per address in 2026), lease one, or queue on a waiting list.
  3. Get an AS number. It requires BGP sessions to two networks or a routing policy of your own.
  4. Publish who may announce it: a route / route6 object and an RPKI ROA naming your ASN as origin.
  5. Announce the prefix over BGP to one or more upstream providers, and nothing but that prefix.
  6. Verify from outside, then point DNS (A/AAAA, PTR) at the addresses.

All addresses and AS numbers below are documentation values: 198.51.100.0/24 and 203.0.113.0/24 (RFC 5737), 2001:db8::/32 (RFC 3849), AS64496–AS64511 (RFC 5398).

Who assigns IP addresses: IANA, RIRs and LIRs

IPv4 addresses, IPv6 addresses and AS numbers each come from one global pool, delegated down a fixed chain:

Delegation of internet numbers. IANA holds the global pools and allocates to the five Regional Internet Registries: AFRINIC, APNIC, ARIN, LACNIC and RIPE NCC. Each registry allocates to its members, the Local Internet Registries. An LIR either assigns PA space to a customer, which stays with the LIR, or sponsors PI space for an end user, which is registered to the end user and portable. Who delegates internet numbers IPv4 · IPv6 · AS numbers: one chain for all three IANA the global pools 5 Regional Internet Registries AFRINIC Africa APNIC Asia-Pacific ARIN North America LACNIC Latin America RIPE NCC Europe · Mid East each allocates to its members LIR: a registry member an ISP, a host, or you · holds its own allocation assigns a slice sponsors PA: provider-aggregatable part of the LIR's block, lent to a customer stays behind when you leave PI: provider-independent registered to you, the LIR only sponsors portable: moves with you Delegation of internet numbers. IANA allocates to the five Regional Internet Registries: AFRINIC, APNIC, ARIN, LACNIC and RIPE NCC. A registry allocates to its members, the Local Internet Registries. An LIR assigns PA space to customers, which stays with the LIR, or sponsors PI space for an end user, which is registered to the end user and portable. Who delegates the numbers IPv4 · IPv6 · AS numbers IANA the global pools 5 Regional Internet Registries AFRINIC APNIC ARIN LACNIC RIPE NCC LIR: a registry member an ISP, a host, or you assigns sponsors PA provider-aggregatable part of the LIR's block stays behind when you leave PI provider-independent registered to you portable: moves with you
IANA → five regional registries → their members (LIRs). PA space stays the LIR's; PI space, or an LIR's own allocation, is what "your own IP" means.
RegistryRegionIPv4 free pool ran outIPv4 still obtainable from the registry
APNICAsia-Pacific15 Apr 2011 (last /8)up to a /23 per member
RIPE NCCEurope, Middle East, Central Asia14 Sep 2012 (last /8) · 25 Nov 2019 (empty)one /24 per new LIR, via waiting list
LACNICLatin America, Caribbean10 Jun 2014 (last /10) · 19 Aug 2020 (empty)recovered space, via waiting list
ARINUSA, Canada, parts of the Caribbean24 Sep 2015at most a /22, via quarterly waiting-list distributions
AFRINICAfricaApr 2017 (exhaustion phase 1)a /24 to a /22 per request (phase 2)

You deal with the registry of the region your network is in.

Provider-independent (PI) space or LIR membership

There are two ways to hold a block, and both make it yours:

End user with PI spaceLIR (registry member)
Contractwith a sponsoring LIR, which files the requestdirectly with the registry
What you holdan assignment: IPv6 /48, an AS numberan allocation: IPv6 /32–/29, a place on the IPv4 waiting list
RIPE NCC fees, 2026€75 a year per PI block and €50 per ASN, billed to the sponsor, which adds its own margin€1,000 sign-up + €1,800 a year, plus €50 per ASN
ARIN fees, 2026$275 a year (3X-Small: up to a /24 of IPv4, a /40 of IPv6 and three ASNs)same schedule: ARIN bills by size, not by membership type
Can assign space to customersnoyes

Either way the request has to be justified: who you are (company registration or ID), what network the numbers are for, and for an AS number, who you will peer with. PA/PI is RIPE vocabulary; ARIN calls the same split reassigned versus directly registered space.

IPv6 is easy, IPv4 is a market

IPv6 is plentiful. A RIPE NCC LIR receives a /32 on request and up to a /29 without further justification (eight /32s, 2³⁵ ≈ 3.4 × 10¹⁰ /64 subnets); an end user receives a /48 of PI (65,536 /64s). The request is usually approved within days and costs only the registry fee above.

IPv4 is gone from the free pools. RIPE NCC has not assigned new IPv4 PI since 2012, so a /24 comes from one of three places:

RouteWhat you getCost / wait
Registry waiting listreclaimed space: RIPE NCC gives an LIR that has never had IPv4 one /24; ARIN at most a /22RIPE NCC, mid-2026: about 750 LIRs queued, the first waiting 15 months. ARIN: over a year
Transfer marketa block bought from its holder and re-registered to you by the registryabout $20–35 per address in 2026 (about $30 a year earlier), so a /24 is roughly $5,000–9,000 plus broker and registry fees
Leasea block the holder lets you announce: a Letter of Authorisation (LOA) plus a ROA for your ASa monthly per-address fee; the holder can take it back

A transfer is a registry procedure, not just a payment. Both parties confirm it in their registry accounts; ARIN checks that the receiver can justify the space (24-month need), RIPE NCC checks the paperwork and then locks the block against re-transfer for 24 months. Only when the database shows you as holder is it yours.

Size matters for routing, not just money. A /24 is the longest IPv4 prefix and a /48 the longest IPv6 prefix that networks across the internet accept. A /25 or a /56 is filtered by most of them and never becomes globally reachable. “One IP of my own” therefore means “a /24 that contains it”.

Get an AS number (ASN)

To announce a prefix yourself you need an Autonomous System Number. It identifies your network in BGP: every route carries the list of ASes it has passed through (the AS path), and the last one in that list, the origin, is the network claiming the prefix.

Private ASNs (64512–65534 and 4200000000–4294967294, RFC 6996) work inside a network but are stripped or rejected on the public internet.

Route object and RPKI ROA: what other networks check

Holding the space is not enough. The routers that will carry your route check public databases before they trust it. Three records do the work:

1. The registration itself: inetnum (IPv4) or inet6num (IPv6) in the registry database, saying who holds the block and which maintainer may edit it, plus aut-num for your ASN.

2. A route object in an Internet Routing Registry (the RIR’s own, or RADb). It states which AS may originate the prefix. Upstream ISPs build the prefix filter for your BGP session from it, usually automatically with a tool such as bgpq4:

route:          198.51.100.0/24
descr:          example network
origin:         AS64500
mnt-by:         EXAMPLE-MNT
source:         RIPE

route6:         2001:db8:4000::/48
origin:         AS64500
mnt-by:         EXAMPLE-MNT
source:         RIPE

3. An RPKI ROA (Route Origin Authorisation), created in the registry’s portal and signed with the certificate the registry issues for your space. It says: prefix 198.51.100.0/24, max length /24, origin AS64500. Routers doing Route Origin Validation (RFC 6811) mark every BGP route valid, invalid or not-found against all published ROAs, and the large transit networks drop the invalid ones.

Two ROA mistakes take your own prefix off the internet: the wrong origin AS, and a max length shorter than what you announce (ROA for a /23 with max length /23, announcement of the two /24s: both invalid). Set max length equal to the prefix length you actually announce (RFC 9319) and create the ROA before the first announcement.

Add reverse DNS while you are in the database: a domain object for 100.51.198.in-addr.arpa (IPv6: 0.0.0.4.8.b.d.0.1.0.0.2.ip6.arpa) delegating the zone to your nameservers, so 198.51.100.10 can resolve back to a name.

Announce the prefix with BGP

The registry records exist; now the numbers have to become a route. This is the chain from the address on your server to every router on the internet:

From registered block to reachable server. In the registry, written once: the inetnum and aut-num objects record that 198.51.100.0/24 and AS64500 are yours; a route object and an RPKI ROA say AS64500 may originate the prefix. On the wire, always: 1, your server has the address 198.51.100.10; 2, your router, AS64500, is its gateway and announces 198.51.100.0/24 over BGP; 3, two upstream ISPs, AS64496 and AS64497, check the announcement against the route object and the ROA and pass it on; 4, internet routers learn a path to AS64500; 5, packets for 198.51.100.10 follow that path back to the server. On top, DNS maps example.com to 198.51.100.10 and a PTR record maps the address back. From registered block to reachable server registry records once · BGP always on · DNS on top IN THE REGISTRY · WRITTEN ONCE inetnum + aut-num 198.51.100.0/24 · AS64500 route object (IRR) origin: AS64500 RPKI ROA AS64500 · max /24 prefix filter origin validation ON THE WIRE · ALWAYS Your server 198.51.100.10 1 Your router AS64500 2 64500 ISP A · AS64496 ISP B · AS64497 3 64496 64500 Internet routers every other AS 4 … 64496 64500 AS path, via ISP A → 5 packets for 198.51.100.10 follow the route back DNS · ON TOP example.com.A198.51.100.10 10.100.51.198.in-addr.arpa.PTRexample.com. From registered block to reachable server. In the registry, once: inetnum and aut-num for 198.51.100.0/24 and AS64500, a route object and an RPKI ROA naming AS64500 as origin. On the wire: 1, your server has 198.51.100.10; 2, your router, AS64500, announces 198.51.100.0/24 over BGP; 3, your ISPs, AS64496 and AS64497, filter and validate the announcement and pass it on; 4, internet routers learn a path to AS64500; 5, packets follow that path back and the server is reachable. DNS maps example.com to 198.51.100.10 and back. Block to reachable server registry once · BGP always on IN THE REGISTRY · WRITTEN ONCE inetnum + aut-num 198.51.100.0/24 route object (IRR) origin: AS64500 RPKI ROA AS64500 · max /24 ON THE WIRE · ALWAYS 1 Your server 198.51.100.10 default gateway 2 Your router · AS64500 announces 198.51.100.0/24 BGP UPDATE 3 ISPs · AS64496, AS64497 prefix filter + origin validation propagate 4 Internet routers AS path … 64496 64500 5 Server is reachable packets follow the route back to AS64500 DNS · ON TOP example.com. A 198.51.100.10 10.100.51.198.in-addr.arpa. PTR example.com.
Registry records are written once and checked by everyone else; the BGP announcement is what makes the block reachable. Announcements travel outward, packets travel back.

1. Server. Inside your network nothing is special: the server takes an address from the block and a default route to your router.

ip addr add 198.51.100.10/24 dev eth0
ip route add default via 198.51.100.1

2. Router and BGP session. You need a provider that will run BGP with you: a transit ISP, a colocation datacentre, or a VPS host that offers BGP sessions. You send them the prefix and ASN (some ask for an LOA); they build a filter from your route object and configure their side. A minimal BIRD 2 configuration that originates the block and announces nothing else:

router id 198.51.100.1;

protocol device { }                        # learn interfaces; BGP needs them to reach the neighbour

protocol kernel {
  ipv4 { export where source = RTS_BGP; }; # install the routes learned from the ISPs
}

protocol static own_v4 {
  ipv4;
  route 198.51.100.0/24 unreachable;       # puts the prefix in BIRD's table so BGP can export it
}

protocol bgp isp_a {
  local as 64500;
  neighbor 203.0.113.1 as 64496;           # the ISP's end of the link
  ipv4 {
    import all;                            # or a default route only
    export where proto = "own_v4";         # announce our prefix, nothing else
  };
}

The second upstream is the same protocol bgp block with its neighbour address and as 64497. Exporting only your own prefix matters: a router that re-exports what it learned from ISP A to ISP B has made itself a transit path between them, which is what a route leak is. The upstreams’ filters are the safety net, not the plan.

3–4. Propagation. Your ISPs pass the route to their peers and transit providers, each prepending its AS to the path, until every network in the default-free zone (routers with no default route, carrying the full table of about a million IPv4 prefixes) has an entry for 198.51.100.0/24. With the session up and the filters open this takes seconds to minutes. The usual delay is the upstream refreshing its IRR-built filter, which some do nightly and some on request.

5. Reachability. From then on a packet for 198.51.100.10 sent anywhere on the internet is forwarded toward AS64500, enters through whichever ISP the sender’s network prefers, and reaches the server.

Check that the prefix is reachable

Look at the route from outside, not from your own router:

# Who holds the block, and is a route object registered?
whois -h whois.ripe.net 198.51.100.0/24
whois -h whois.radb.net 198.51.100.0/24

# RPKI: is AS64500 a valid origin? (RIPEstat public API)
curl -s 'https://stat.ripe.net/data/rpki-validation/data.json?resource=AS64500&prefix=198.51.100.0/24'

# Do the public route collectors (RIPE RIS) see it, and with what AS path?
curl -s 'https://stat.ripe.net/data/looking-glass/data.json?resource=198.51.100.0/24'

# End-to-end, from a machine outside your network
traceroute 198.51.100.10
CheckExpectedIf not
whoisholder is you; route object with origin: AS64500create or fix the route object
RPKIvalidinvalid: fix the ROA before anything else. unknown: no ROA yet
Collectorspaths ending 64496 64500 and 64497 64500an upstream is still filtering: ask it to refresh its prefix filter
tracerouteends at your serverroute is there but packets die: check the router’s forwarding and firewall

DNS: A record and reverse PTR

DNS does not make an address reachable. It maps a name onto an address that already is:

example.com.                   A    198.51.100.10
10.100.51.198.in-addr.arpa.    PTR  example.com.

The A record lives in the zone of whoever hosts example.com. The PTR lives in the reverse zone the registry delegated to your nameservers through the domain object above. Mail is where it bites: Gmail and most large receivers reject a sender whose address has no PTR, or whose PTR name does not resolve back to the same address. How a resolver walks from the root to that A record is shown step by step in the DNS recursive resolution simulator.

Without your own router: BYOIP, hosted announcement, leasing

FAQ: getting your own IP addresses

Can I get a single IP address of my own?

Not one that is routed by itself. The smallest block accepted across the internet is a /24 of IPv4 or a /48 of IPv6, so you hold the whole block and use as much of it as you need. A “static IP” from an ISP is one address of the ISP’s PA space, on loan for the length of the contract.

How much does it cost to get your own IP addresses?

IPv6 with an ASN through a sponsoring LIR in the RIPE region: €125 a year in registry fees (€75 for the /48, €50 for the ASN) plus the sponsor’s margin. An IPv4 /24 on top: roughly $5,000–9,000 once to buy, or a monthly lease. As a RIPE NCC member: €1,000 once and €1,800 a year. At ARIN: $275 a year for up to a /24, a /40 of IPv6 and three ASNs. Then the BGP session, which some providers include and some charge for.

Do I need an ASN to use my own IP addresses?

No. A provider can originate your block from its ASN (an LOA, a ROA naming its AS), and cloud BYOIP works the same way. You need your own ASN once you announce the block yourself, which is also the only way to use two upstreams at once.

How long does it take?

IPv6 PI and an ASN: days, most of it document checks. A purchased IPv4 block: one to a few weeks for the transfer. A waiting-list /24: more than a year. Once the route object and ROA exist, the announcement itself is visible worldwide within minutes.

Can I announce my own IP addresses from a home connection?

Not natively: residential ISPs do not run BGP with customers. The common workaround is a VPS or router at a provider that does, with a tunnel (WireGuard, GRE) carrying the block home.

TL;DR: “Your own IP” is a block registered to you at a Regional Internet Registry (RIPE NCC, ARIN, APNIC, LACNIC, AFRINIC), as an LIR member or as PI space through a sponsoring LIR. IPv6 is there for the asking (/48 PI, up to a /29 per LIR); IPv4 comes from a waiting list, the transfer market (about $20–35 per address in 2026) or a lease, and has to be at least a /24 to be routed. Get an ASN, register a route object and sign an RPKI ROA for it, then announce the prefix over BGP to your upstreams, and only that prefix. Check it on whois, RIPEstat and the route collectors, then point DNS (A, PTR) at it.

Questions? Let's Chat :)

network