<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>BGP on Jonatan Miarecki</title><link>https://miarecki.eu/tags/bgp/</link><description>The latest posts on Jonatan Miarecki</description><language>en</language><managingEditor>jonatan@miarecki.eu (Jonatan Miarecki)</managingEditor><webMaster>jonatan@miarecki.eu (Jonatan Miarecki)</webMaster><lastBuildDate>Tue, 24 Nov 2026 11:46:34 +0100</lastBuildDate><atom:link href="https://miarecki.eu/tags/bgp/index.xml" rel="self" type="application/rss+xml"/><atom:link rel="search" type="application/opensearchdescription+xml" href="https://miarecki.eu/opensearch.xml" title="Search all available posts"/><item><title>Running your own Autonomous System</title><link>https://miarecki.eu/posts/running-your-own-autonomous-system/</link><pubDate>Tue, 23 Jun 2026 15:00:00 +0200</pubDate><author>jonatan@miarecki.eu (Jonatan Miarecki)</author><guid>https://miarecki.eu/posts/running-your-own-autonomous-system/</guid><description>A beginner-friendly guide to getting your own ASN and IPv6 space, setting up BGP with BIRD, peering at IXPs, running a Looking Glass, and RPKI/ASPA.</description><content:encoded> <![CDATA[<p>When you get internet at home from your ISP, you are their customer. Your router only knows about two places: your local devices, and one default gateway pointing to your ISP. You hand them your packets, and they figure out where they need to go.</p>
<p>For most people, that is all you ever need. But how does traffic actually get from your ISP to every other network on Earth?</p>
<p>The Internet is made up of tens of thousands of independent networks that interconnect using BGP (Border Gateway Protocol). In BGP, Autonomous System Numbers (ASNs) are used to differentiate networks with different routing policies so they can exchange reachability information with each other.</p>
<p>I first fell down this rabbit hole years before university after learning that IPv4 addresses had run out and wondering what solutions exist. That led me to IPv6, then to <a href="https://dn42.dev/">DN42</a> (a virtual overlay network where people practice real BGP over WireGuard tunnels), and eventually to getting my own ASN, <a href="https://as219421.miarecki.eu">AS219421</a>, from RIPE NCC.</p>
<p>This post walks through what getting and running your own Autonomous System looks like from start to finish: applying for an ASN and IP space, getting a server connected, setting up BGP and peering, letting others look into your network, securing your routing, and testing changes safely. You do not need prior BGP experience to follow along, though basic Linux administration, comfort with the command line, and a rough grasp of IPv6 subnetting and routing will make things much smoother.</p>
<figure>
    <img loading="lazy" src="/posts/running-your-own-autonomous-system/home-vs-as.svg"
         alt="Side-by-side comparison showing a home router forwarding all traffic via a single default route to one ISP versus an Autonomous System router running BGP to announce its own IPv6 prefix to transit providers and peer directly at an IXP switch"/> <figcaption>
            <p>A home router hands everything to one ISP via a default route, whereas an Autonomous System speaks BGP to announce its own prefix and pick paths across transit providers and IXP peers.</p>
        </figcaption>
</figure>

<h2 id="getting-an-asn-and-ip-space">Getting an ASN and IP space</h2>
<p>ASNs are hierarchical. You cannot just ask at the very top, you have to go a bit lower down the chain. IANA manages the global pools of IP addresses and ASNs and hands them out to five Regional Internet Registries (RIRs). Each RIR then distributes resources to Local Internet Registries (LIRs).</p>
<p>Becoming an LIR yourself costs quite a bit every year (over 1,500 EUR/year at RIPE NCC), and you do not need to become an LIR just to run your own AS. Instead, an LIR can sponsor your ASN and IP allocation on your behalf.</p>
<p>Different RIRs have different rules and fees. In Europe, the Middle East, and parts of Central Asia, <a href="https://www.ripe.net/">RIPE NCC</a> lets individuals register an organisation object under their own name without needing to form a company. Under RIPE&rsquo;s <a href="https://www.ripe.net/publications/docs/ripe-848/">2026 charging scheme</a>, RIPE charges 50 EUR/year for a sponsored ASN and 75 EUR/year for an independent IPv4 or IPv6 Provider Independent (PI) assignment.</p>
<p>There are plenty of sponsoring LIRs out there, like <a href="https://lagrange.cloud/">Lagrange Cloud</a> or <a href="https://nopkt.com/">NoPKT</a>. I went with NoPKT because they offered a combo with a <code>/40</code> PA (Provider Aggregatable) IPv6 block included alongside the ASN request. You do need to provide identification and verify it with RIPE, and you need to live in or have network presence in the service region. With NoPKT it went really fast, under a day. Because they are in a US timezone, by the time they sent the application to RIPE it was morning here, and RIPE had already read, approved, and verified my ID. The whole thing took less than 16 hours from start to finish, though depending on the LIR and verification queue it can take anywhere from a day to a couple of weeks.</p>
<p>In my case, the ASN cost 75 USD/year (which covers RIPE&rsquo;s 50 EUR/year ASN fee plus LIR sponsorship) and the <code>/40</code> PA IPv6 prefix was 12 USD for 3 years. Because PA space is sub-allocated out of an LIR&rsquo;s block, it does not carry RIPE&rsquo;s separate yearly independent resource fee (unlike PI space), though your LIR may still charge a small fee. On top of that, budget for either a BGP-capable VPS (often starting around 5 to 10 EUR/month depending on location and provider, or roughly 10 USD/month if you also want an IXP port with some upfront setup fees) or a free/low-cost tunnel upstream.</p>
<h3 id="ip-space-pa-vs-pi-and-geolocation">IP space, PA vs. PI, and geolocation</h3>
<p>Because IPv4 is exhausted and expensive, you will almost certainly start with IPv6. Common Internet filtering policies accept IPv6 prefixes up to a <code>/48</code> (and IPv4 prefixes up to a <code>/24</code>). These are operational conventions rather than hard protocol limits, so try to get a block larger than a <code>/48</code>, meaning a shorter prefix length such as a <code>/44</code> or <code>/40</code>.</p>
<p>You will run into two terms when getting IP space: Provider Aggregatable (PA) space is sub-allocated to you out of an LIR&rsquo;s larger block (<code>ALLOCATED-BY-LIR</code> in the RIPE Database, which is what my <code>/40</code> from NoPKT is) and can be sub-allocated or assigned further depending on your LIR and RIPE policy. Provider Independent (PI) space is assigned directly to you by the RIR through a sponsoring LIR, carries RIPE&rsquo;s 75 EUR/year independent resource fee, requires justification for anything larger than a <code>/48</code>, and under RIPE policy cannot be sub-assigned to other organisations. Unless you have a specific use case that requires PI space, PA is fine.</p>
<p>The RIPE Database itself uses a syntax called RPSL (Routing Policy Specification Language) with fields like <code>mnt-by</code>, <code>admin-c</code>, <code>tech-c</code>, and <code>abuse-c</code>. If those look unfamiliar at first, the <a href="https://docs.db.ripe.net/">RIPE Database documentation</a> explains every object type cleanly.</p>
<p>Once you start announcing your prefixes, you might also want geolocation providers to know the rough area of your IPs. By default, most fall back to your IRR organisation record in the database (even individuals are listed under an <code>org</code> object). If you announce space in another city or country, you can publish an <a href="https://datatracker.ietf.org/doc/html/rfc8805">RFC 8805</a> <code>geofeed.csv</code> file and link it directly from your <code>inet6num</code> object. Geofeeds are only advisory, so not every commercial geolocation database picks them up right away.</p>
<h2 id="getting-a-server-and-connectivity">Getting a server and connectivity</h2>
<p>You might already have a server like a Raspberry Pi at home, but connecting it directly to other networks is tricky. At least in Germany, the big ISPs will not just give you a BGP session.</p>
<p>Here are some common ways to get connected to the wider Internet:</p>
<h3 id="colocation">Colocation</h3>
<p>Facilities around the world let you install your own physical server, providing rack space, power, and internet. Many are directly connected to an IXP or multiple transit providers in the same building, so you can get connectivity right there. This is the most hands-on method, but also the most expensive since you have to buy and install your own hardware.</p>
<h3 id="getting-a-bgp-capable-vps">Getting a BGP-capable VPS</h3>
<p>Someone else has already installed servers in a data center and got BGP connectivity running. You rent a Linux server and announce your prefixes from there. Just search for a BGP-capable VPS provider, such as <a href="https://my.pdxnet.co.uk/">Paradox Networks</a> or the community lists at <a href="https://bgp.services/">bgp.services</a>.</p>
<h3 id="tunneled-upstreams">Tunneled upstreams</h3>
<p>If you already have a server without native BGP, you can connect to an upstream over something similar to a VPN, like WireGuard or GRE, and they announce your prefixes to the wider Internet. Examples of hobby-friendly tunnel providers include <a href="https://bgp.tools/as/41051">Freetransit Project (AS41051)</a>, <a href="https://bgp.tools/as/212895">Route64 (AS212895)</a>, <a href="https://bgp.tools/as/209533">iFog BGPTunnel (AS209533)</a>, <a href="https://bgp.tools/as/197324">Vladyslav Koba (AS197324)</a>, <a href="https://bgp.tools/as/47272">HYEHOST (AS47272)</a>, ShadowIP (<code>AS218995</code>), and FreePKT (<code>AS219331</code>).</p>
<h2 id="setting-up-your-first-bgp-session">Setting up your first BGP session</h2>
<p>Since you are most likely a greenfield network starting from zero, you have the freedom to choose your setup. Just be careful with it, because changing your architecture or renumbering your network later is not much fun.</p>
<p>On Linux, <a href="https://bird.network.cz/">BIRD</a> is the most popular routing daemon for hobby and small networks. Most distros still package BIRD 2 by default, which works fine. If you want BIRD 3 (for multi-threading and built-in ASPA support), you can install it from <a href="https://pkg.labs.nic.cz/doc/?project=bird">CZ.NIC&rsquo;s package repository</a>, though some syntax and niche settings are slightly different.</p>
<p>Once you have a connection with someone willing to provide transit, you configure <code>/etc/bird/bird.conf</code> to establish a BGP session and exchange reachability information. Instead of only pointing a default route like <code>::/0</code> (or if you are into legacy IPv4, <code>0.0.0.0/0</code>) over transit, your upstream can send you every single prefix on the Internet, called a full table.</p>
<p>Taking a full table lets your router pick its own paths once you add a second transit provider or connect to an IXP, for example preferring the shortest AS-Path or an IXP over paid transit. Plenty of small hobby networks start with default-only or partial routes instead: a full IPv6 table is roughly 250,000 routes (fine on 1 to 2 GB of RAM), while each full IPv4 upstream feed adds over a million routes, so taking full IPv4 tables from multiple upstreams can require several gigabytes of RAM depending on your BIRD version and route sharing (you can check usage with <code>birdc show memory</code>).</p>
<p>BIRD keeps its own routing tables separate from the Linux kernel&rsquo;s forwarding table, so the <code>kernel</code> protocol below is what syncs BIRD&rsquo;s selected routes into Linux so packets actually get forwarded. Also remember that receiving a route over BGP is not enough on its own: the BGP next hop has to be reachable in your routing table too, which is a common gotcha when using IPv6 transit tunnels where the BGP session and forwarding path use different addresses.</p>
<p>The BIRD 3 example below uses documentation addresses (<code>2001:db8::/32</code> must never be announced on the public Internet) and assumes a <a href="/posts/running-your-own-autonomous-system/#self-hosting-your-rpki-and-aspa-validator">local RPKI and ASPA validator</a> on <code>127.0.0.1:3323</code> (we will cover what RPKI, ASPA, and BGP roles actually do in the sections below). It is still simplified for readability. In production, you should also add max-prefix limits (<code>receive limit</code>), strict prefix-length bounds (rejecting anything longer than <code>/48</code> for IPv6 or <code>/24</code> for IPv4), and bogon-ASN filtering:</p>
<details>
<summary>First BIRD 3 BGP session with RPKI ROA, ASPA, RFC 9234 role, and bogon/own-prefix filtering (RFC 3849 / RFC 5737 / RFC 5398 documentation IPs and ASNs)</summary>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span><span class="lnt">33
</span><span class="lnt">34
</span><span class="lnt">35
</span><span class="lnt">36
</span><span class="lnt">37
</span><span class="lnt">38
</span><span class="lnt">39
</span><span class="lnt">40
</span><span class="lnt">41
</span><span class="lnt">42
</span><span class="lnt">43
</span><span class="lnt">44
</span><span class="lnt">45
</span><span class="lnt">46
</span><span class="lnt">47
</span><span class="lnt">48
</span><span class="lnt">49
</span><span class="lnt">50
</span><span class="lnt">51
</span><span class="lnt">52
</span><span class="lnt">53
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-gdscript3" data-lang="gdscript3"><span class="line"><span class="cl"><span class="n">router</span> <span class="n">id</span> <span class="mf">192.0</span><span class="o">.</span><span class="mf">2.1</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">protocol</span> <span class="n">device</span> <span class="p">{}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">protocol</span> <span class="n">kernel</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="n">ipv6</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="c1"># Intentionally broad for this example; use an explicit export filter in production</span>
</span></span><span class="line"><span class="cl">        <span class="k">export</span> <span class="n">all</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="p">};</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">protocol</span> <span class="k">static</span> <span class="n">my_prefixes</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="n">ipv6</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Placeholder to originate the /48; real addresses live on more-specific subnets</span>
</span></span><span class="line"><span class="cl">    <span class="n">route</span> <span class="mi">2001</span><span class="p">:</span><span class="n">db8</span><span class="p">:</span><span class="mi">1</span><span class="p">::</span><span class="o">/</span><span class="mi">48</span> <span class="n">blackhole</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">roa4</span> <span class="n">table</span> <span class="n">roa_v4</span> <span class="p">{</span> <span class="n">trie</span> <span class="n">on</span><span class="p">;</span> <span class="p">};</span>
</span></span><span class="line"><span class="cl"><span class="n">roa6</span> <span class="n">table</span> <span class="n">roa_v6</span> <span class="p">{</span> <span class="n">trie</span> <span class="n">on</span><span class="p">;</span> <span class="p">};</span>
</span></span><span class="line"><span class="cl"><span class="n">aspa</span> <span class="n">table</span> <span class="n">aspa_table</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">protocol</span> <span class="n">rpki</span> <span class="n">rpki_local</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="n">roa4</span> <span class="p">{</span> <span class="n">table</span> <span class="n">roa_v4</span><span class="p">;</span> <span class="p">};</span>
</span></span><span class="line"><span class="cl">    <span class="n">roa6</span> <span class="p">{</span> <span class="n">table</span> <span class="n">roa_v6</span><span class="p">;</span> <span class="p">};</span>
</span></span><span class="line"><span class="cl">    <span class="n">aspa</span> <span class="p">{</span> <span class="n">table</span> <span class="n">aspa_table</span><span class="p">;</span> <span class="p">};</span>
</span></span><span class="line"><span class="cl">    <span class="n">remote</span> <span class="s2">&#34;127.0.0.1&#34;</span> <span class="n">port</span> <span class="mi">3323</span><span class="p">;</span> <span class="c1"># local validator (see &#34;Going further&#34; below)</span>
</span></span><span class="line"><span class="cl">    <span class="n">retry</span> <span class="n">keep</span> <span class="mi">90</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">refresh</span> <span class="n">keep</span> <span class="mi">900</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">expire</span> <span class="n">keep</span> <span class="mi">172800</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">filter</span> <span class="n">import_transit_v6</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Reject your own prefix so an upstream cannot reflect it back</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">net</span> <span class="o">~</span> <span class="p">[</span> <span class="mi">2001</span><span class="p">:</span><span class="n">db8</span><span class="p">:</span><span class="mi">1</span><span class="p">::</span><span class="o">/</span><span class="mi">48</span><span class="o">+</span> <span class="p">]</span> <span class="n">then</span> <span class="n">reject</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Reject default route and illustrative special-purpose/bogon prefixes</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># (remove ::/0 if your upstream only sends a default route; use maintained bogon lists in production)</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">net</span> <span class="o">~</span> <span class="p">[</span> <span class="p">::</span><span class="o">/</span><span class="mi">0</span><span class="p">,</span> <span class="n">fc00</span><span class="p">::</span><span class="o">/</span><span class="mi">7</span><span class="o">+</span><span class="p">,</span> <span class="n">fe80</span><span class="p">::</span><span class="o">/</span><span class="mi">10</span><span class="o">+</span><span class="p">,</span> <span class="n">ff00</span><span class="p">::</span><span class="o">/</span><span class="mi">8</span><span class="o">+</span><span class="p">,</span> <span class="mi">2001</span><span class="p">:</span><span class="n">db8</span><span class="p">::</span><span class="o">/</span><span class="mi">32</span><span class="o">+</span><span class="p">,</span> <span class="mi">3</span><span class="n">fff</span><span class="p">::</span><span class="o">/</span><span class="mi">20</span><span class="o">+</span> <span class="p">]</span> <span class="n">then</span> <span class="n">reject</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">roa_check</span><span class="p">(</span><span class="n">roa_v6</span><span class="p">)</span> <span class="o">=</span> <span class="n">ROA_INVALID</span> <span class="n">then</span> <span class="n">reject</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Third arg: false = route received from a transit provider; true = received from a customer, lateral peer, or IXP route server</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">aspa_check</span><span class="p">(</span><span class="n">aspa_table</span><span class="p">,</span> <span class="n">bgp_path</span><span class="p">,</span> <span class="bp">false</span><span class="p">)</span> <span class="o">=</span> <span class="n">ASPA_INVALID</span> <span class="n">then</span> <span class="n">reject</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">accept</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">protocol</span> <span class="n">bgp</span> <span class="n">upstream_v6</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="n">local</span> <span class="n">as</span> <span class="mi">64496</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">neighbor</span> <span class="mi">2001</span><span class="p">:</span><span class="n">db8</span><span class="p">::</span><span class="mi">1</span> <span class="n">as</span> <span class="mi">64497</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">local</span> <span class="n">role</span> <span class="n">customer</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">enforce</span> <span class="n">first</span> <span class="n">as</span> <span class="n">on</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">ipv6</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="n">import</span> <span class="n">filter</span> <span class="n">import_transit_v6</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">        <span class="k">export</span> <span class="n">where</span> <span class="n">net</span> <span class="o">~</span> <span class="p">[</span> <span class="mi">2001</span><span class="p">:</span><span class="n">db8</span><span class="p">:</span><span class="mi">1</span><span class="p">::</span><span class="o">/</span><span class="mi">48</span> <span class="p">];</span>
</span></span><span class="line"><span class="cl">    <span class="p">};</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></td></tr></table>
</div>
</div></details>
<p>Once BIRD is running, you can check whether your session came up with:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">birdc show protocols
</span></span><span class="line"><span class="cl">birdc show protocols all
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="peering-ixps-communication-and-your-as-set">Peering, IXPs, communication, and your AS-SET</h2>
<p>With a transit provider, traffic destined for networks learned through transit goes through them, and they handle peering with everyone else. If you want a direct connection to a network you exchange a lot of traffic with, either to lower latency by bypassing your transit or to avoid paying per unit of data that some transit providers bill for, you can peer directly.</p>
<p>Running physical cables to everyone you want to connect to gets out of hand fast unless you are a large enterprise, so most networks connect to an Internet Exchange Point (IXP). An IXP is basically a big network switch where you can talk to every other participant plugged into it. Many IXPs feature a route server so every participant sends their routes once and receives everyone else&rsquo;s automatically, and you can also peer directly (bilaterally) over the same switch. Some VPS providers even allow you to connect your VPS directly to an IXP port, making it much easier to access an IXP without colocation. Servers with IXP connectivity are usually around 10 USD/month with some upfront IXP connection costs, though if you look around hobbynet communities you will often find personal offers.</p>
<h3 id="communication-noc-email-and-peeringdb">Communication, NOC email, and PeeringDB</h3>
<p>Before you start peering, it is best to set up a dedicated NOC email address (something like <code>noc@yourdomain.tld</code>) since it will be publicly visible in the IRR and on sites like <a href="https://www.peeringdb.com/">PeeringDB</a>. PeeringDB lists how to peer with a network, which IXPs they are on, and which interconnection facilities they operate in, and it is also where other operators find your contact details when they want to peer or report an issue.</p>
<p>Once you join a common IXP where Tier-1 networks are present, you will almost certainly start receiving peering emails from them. Hurricane Electric will gladly peer with you and can occasionally even offer free IPv6 transit. Do not contact <span class="inline-emoji-wrap">Cogent.<img src="catceo6939.webp" alt="Hurricane Electric depicted as a Meowl (cat-owl) standing behind a podium with microphones saying 'Bilateral peering for everybody and anybody', while a smaller cat beside it replies 'I love my gifted transit. You are a superhero.'" class="inline-emoji"></span></p>
<h3 id="peering-relationships-rfc-9234-roles">Peering relationships (RFC 9234 roles)</h3>
<p><a href="https://datatracker.ietf.org/doc/html/rfc9234">RFC 9234</a> defines standard BGP roles so both sides of a session agree on their relationship. In BIRD, <code>local role</code> specifies <em>your</em> role in the session, not your neighbor&rsquo;s:</p>
<ul>
<li><code>customer</code> (when connecting to a transit upstream)</li>
<li><code>provider</code> (when connecting to a downstream customer)</li>
<li><code>peer</code> (lateral peering with another network)</li>
<li><code>rs_client</code> / <code>rs_server</code> (connecting to an IXP route server)</li>
</ul>
<p>Setting roles lets both sides negotiate their relationship and enables the RFC 9234 OTC (Only to Customer) attribute. When supported, OTC gets attached when sending routes to customers, peers, or route server clients and checked on receipt, preventing routes learned from providers, peers, or route servers from accidentally leaking upward to another transit or peer.</p>
<h3 id="filtering-different-types-of-peers">Filtering different types of peers</h3>
<p>Because each relationship has different trust boundaries, you do not use the same BGP filter for every session:</p>
<table>
	<thead>
			<tr>
					<th>Session type</th>
					<th>What you import</th>
					<th>What you export</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Transit (<code>local role customer</code>)</td>
					<td>Full table (or default route), dropping bogons, own prefixes, RPKI/ASPA invalids</td>
					<td>Strictly your own prefixes + downstream customers</td>
			</tr>
			<tr>
					<td>IXP Route Server (<code>local role rs_client</code>)</td>
					<td>Everything the RS sends, minus bogons, RPKI/ASPA invalids, and routes leaking Tier-1/transit-free ASNs mid-path (plus max-prefix limits)</td>
					<td>Strictly your own prefixes + downstream customers</td>
			</tr>
			<tr>
					<td>Bilateral Peer (<code>local role peer</code>)</td>
					<td>Only prefixes matching the peer&rsquo;s <a href="/posts/running-your-own-autonomous-system/#automating-irr-peer-filters-with-bgpq4">IRR <code>as-set</code></a> + <code>enforce first as</code> + RPKI/ASPA</td>
					<td>Strictly your own prefixes + downstream customers</td>
			</tr>
			<tr>
					<td>Downstream Customer (<code>local role provider</code>)</td>
					<td>Strictly prefixes authorized for that customer + <code>enforce first as</code> + RPKI/ASPA</td>
					<td>Full table (or default route)</td>
			</tr>
	</tbody>
</table>
<h3 id="your-as-set">Your AS-SET</h3>
<p>Whenever you peer with someone, both sides want protection against misconfiguration. By default BGP has no safeguards: nothing stops you from claiming Google, Cloudflare, or Hurricane Electric is your downstream and announcing their routes.</p>
<p>To combat this, you maintain an <a href="https://docs.db.ripe.net/RPSL-Object-Types/Descriptions-of-Secondary-Objects/#description-of-the-as-set-object"><code>as-set</code></a> object in the RIPE Database, like mine (<a href="https://apps.db.ripe.net/db-web-ui/query?searchtext=AS219421:AS-ALL">AS219421:AS-ALL</a>). Your <code>as-set</code> contains your own ASN plus the ASNs (or <code>as-set</code>s) of your downstream customers, never your peers or transit providers. Including your own ASN is important: if you leave it out, peers building filters from your <code>as-set</code> will filter out your own prefixes too.</p>
<h2 id="letting-others-look-into-your-network">Letting others look into your network</h2>
<p>When routing breaks somewhere on the Internet, other operators cannot SSH into your router to debug it. That is why many networks publish a network info page (like <a href="https://as219421.miarecki.eu">as219421.miarecki.eu</a>) and run a Looking Glass (like <a href="https://lg.as219421.miarecki.eu">lg.as219421.miarecki.eu</a>).</p>
<p>A Looking Glass is a public web interface that lets other operators look into your network to see your routes, paths, and peers for debugging. It is optional, though it is also very convenient for yourself since you can check all your connections and details in a browser without SSHing into the router.</p>
<p>There are multiple Looking Glass tools available, like <a href="https://github.com/alice-lg/alice-lg">Alice-LG</a> (with <code>birdwatcher</code>) or <a href="https://github.com/xddxdd/bird-lg-go">bird-lg-go</a>. Comparing them, Alice-LG keeps a copy of all routes in memory and offers more features, which makes it more expensive on RAM (easily over 1.5 GB with full tables). I went with <code>bird-lg-go</code> because I had seen others use it and it stays light on memory (under 30 MB total) by querying BIRD on demand. Setting it up in full is outside the scope of this post, but it is just two Docker containers: one hosting the dashboard and one proxy collecting data from your BIRD instance.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<figure>
    <img loading="lazy" src="/posts/running-your-own-autonomous-system/lg.png"
         alt="AS219421 bird-lg-go Looking Glass showing Established BGP protocols on the Amsterdam (lorentz) router, including bgptools, AS112, Hurricane Electric, iBGP sessions, and InterIX route servers"/> <figcaption>
            <p>My bird-lg-go Looking Glass displaying active BGP sessions and protocol status directly in the browser.</p>
        </figcaption>
</figure>

<details>
<summary>Example bird-lg-go Docker Compose setup (dashboard bound to localhost:5000 behind a TLS reverse proxy, proxy on an internal network)</summary>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span><span class="lnt">32
</span><span class="lnt">33
</span><span class="lnt">34
</span><span class="lnt">35
</span><span class="lnt">36
</span><span class="lnt">37
</span><span class="lnt">38
</span><span class="lnt">39
</span><span class="lnt">40
</span><span class="lnt">41
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">services</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">bird-lgproxy</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="c"># Pin a specific tag or digest in production instead of :latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">xddxdd/bird-lgproxy-go:latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">unless-stopped</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">environment</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">BIRDLG_LISTEN=:8000</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">BIRD_SOCKET=/var/run/bird/bird.ctl</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">ALLOWED_IPS=172.30.10.2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">/run/bird:/var/run/bird</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">networks</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">lg-internal</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">ipv4_address</span><span class="p">:</span><span class="w"> </span><span class="m">172.30.10.3</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">aliases</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span>- <span class="l">router1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">bird-lg</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">xddxdd/bird-lg-go:latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">unless-stopped</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="c"># Bind to localhost and put a TLS reverse proxy in front</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s2">&#34;127.0.0.1:5000:5000&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">environment</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">BIRDLG_SERVERS=router1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">BIRDLG_PROXY_PORT=8000</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">BIRDLG_TITLE_BRAND=My AS Looking Glass</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">BIRDLG_TRUST_PROXY_HEADERS=true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">networks</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">lg-external</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">lg-internal</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">ipv4_address</span><span class="p">:</span><span class="w"> </span><span class="m">172.30.10.2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">networks</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">lg-external</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l">bridge</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">lg-internal</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">internal</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ipam</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">config</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">subnet</span><span class="p">:</span><span class="w"> </span><span class="m">172.30.10.0</span><span class="l">/29</span><span class="w">
</span></span></span></code></pre></td></tr></table>
</div>
</div></details>
<p>A Looking Glass shows what your own network sees, whereas public route collectors like <a href="https://bgp.tools/">bgp.tools</a>, <a href="https://ris.ripe.net/">RIPE RIS</a>, <a href="https://www.routeviews.org/">RouteViews</a>, or the Hurricane Electric route collector show what other networks see from vantage points around the Internet. Peering with them and feeding them your BGP table gives them data for their public search engines and lets you check how your prefixes propagate from the outside. <code>bgp.tools</code> is especially good because their monitoring is free for personal networks.</p>
<figure>
    <img loading="lazy" src="/posts/running-your-own-autonomous-system/as219421-ipv6.svg"
         alt="Hurricane Electric BGP Toolkit IPv6 graph for AS219421 showing multiple upstream and peering paths connecting upward to Tier-1 networks including Arelion AS1299, Lumen AS3356, NTT AS2914, Deutsche Telekom AS3320, GTT AS3257, TATA AS6453, Verizon AS701, and Cogent AS174"/> <figcaption>
            <p>My AS219421 IPv6 connectivity graph from Hurricane Electric&rsquo;s BGP Toolkit, showing how paths branch out to global Tier-1 carriers.</p>
        </figcaption>
</figure>

<h2 id="routing-security">Routing security</h2>
<p>BGP is built on trust. There is nothing stopping you from announcing a prefix you do not own, like someone else&rsquo;s <code>/24</code> or <code>/48</code>. Just do not ever test hijacked prefixes on the live Internet table: only ever try that in a local test lab, because you really do not want to be announcing other people&rsquo;s prefixes.</p>
<p>In BGP, things usually break in two ways: a prefix hijack (an AS originates a prefix it is not authorized to announce) and a route leak (an AS propagates routes beyond its intended routing relationship, like leaking transit routes to another provider or peer). Over time, standards have been created to improve global routing security across both the control plane (which routes you accept) and the data plane (which packets you forward).</p>
<h3 id="irr-inet6num-and-route6">IRR (<code>inet6num</code> and <code>route6</code>)</h3>
<p>Just as you registered your ASN in the IRR, you also register your prefixes there. An <code>inet6num</code> (or <code>inetnum</code> for IPv4) defines the prefix and lets you add a description and geofeed. A <code>route6</code> (or <code>route</code>) object defines which ASN is allowed to announce it. Many Tier-1 networks filter directly by IRR data (see <a href="https://routing.he.net/algorithm.html">Hurricane Electric&rsquo;s routing algorithm</a>).</p>
<p>Below are my real <code>/40</code> allocation and one of the <code>/44</code> sub-allocations I announce from it, queried directly from RIPE:</p>
<details>
<summary>Example RIPE DB inet6num object (my /40 allocation)</summary>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">$ whois -h whois.ripe.net 2a14:7581::/40
</span></span><span class="line"><span class="cl">inet6num:       2a14:7581::/40
</span></span><span class="line"><span class="cl">netname:        NET-JM207-2A14758100
</span></span><span class="line"><span class="cl">country:        DE
</span></span><span class="line"><span class="cl">org:            ORG-JM207-RIPE
</span></span><span class="line"><span class="cl">admin-c:        JM23920-RIPE
</span></span><span class="line"><span class="cl">tech-c:         JM23920-RIPE
</span></span><span class="line"><span class="cl">geofeed:        https://as219421.miarecki.eu/geofeed.csv
</span></span><span class="line"><span class="cl">status:         ALLOCATED-BY-LIR
</span></span><span class="line"><span class="cl">mnt-by:         NoPKT-MNT
</span></span><span class="line"><span class="cl">mnt-by:         MIARECKI-MNT
</span></span><span class="line"><span class="cl">created:        2026-06-15T15:42:51Z
</span></span><span class="line"><span class="cl">source:         RIPE
</span></span></code></pre></td></tr></table>
</div>
</div></details>
<details>
<summary>Example RIPE DB route6 object (/44 sub-allocation)</summary>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">$ whois -h whois.ripe.net 2a14:7581::/44AS219421
</span></span><span class="line"><span class="cl">route6:         2a14:7581::/44
</span></span><span class="line"><span class="cl">origin:         AS219421
</span></span><span class="line"><span class="cl">descr:          Route object for 2a14:7581::/44
</span></span><span class="line"><span class="cl">created:        2026-06-16T23:04:43Z
</span></span><span class="line"><span class="cl">source:         RIPE
</span></span><span class="line"><span class="cl">mnt-by:         MIARECKI-MNT
</span></span></code></pre></td></tr></table>
</div>
</div></details>
<h3 id="enforce-first-as">Enforce first AS</h3>
<p>On normal direct eBGP sessions (everything except transparent IXP route servers, which intentionally omit their own ASN from the path), enable <code>enforce first as on;</code> in BIRD so a peer cannot send routes whose first AS in the path does not match their own ASN.</p>
<h3 id="rpki">RPKI</h3>
<p>Many IRR databases, such as RADb or ALTDB, are non-authoritative, meaning almost anyone can write entries into them. To address this, RPKI (Resource Public Key Infrastructure) was created.</p>
<p>RPKI is cryptographically signed from top to bottom, from the RIR down to the resource holder, proving who is allowed to announce which prefix via ROAs (Route Origin Authorizations). For my PA space from NoPKT (as with most sponsoring LIRs), they provide a portal where you can create and manage your ROAs directly. When creating a ROA, set your origin ASN and a tight maximum prefix length (<code>maxLength</code>) matching the prefix length you actually announce, since an overly loose <code>maxLength</code> weakens its protection.</p>
<p>When your router checks incoming routes against ROAs, there are three possible states: <code>ROA_VALID</code> (matches a ROA, accept), <code>ROA_INVALID</code> (conflicts with an existing ROA, reject), and <code>ROA_UNKNOWN</code> / NotFound (no covering ROA exists yet, normally accept subject to your other filters rather than dropping).</p>
<h3 id="aspa">ASPA</h3>
<p>ROAs only verify the origin of a prefix. They do not stop a route leak where a network takes routes learned from one upstream provider and leaks them to another provider or peer, or inserts itself into a path as a fake upstream at an IXP to pull traffic away from its real destination.</p>
<p>ASPA (Autonomous System Provider Authorization) extends RPKI so networks also sign who their authorized upstream providers are. Receivers can then check the AS path step by step in a chain and reject many invalid paths. Just like with RPKI ROAs, only reject <code>ASPA_INVALID</code>. <code>ASPA_UNKNOWN</code> simply means full ASPA coverage is not there yet along the path, so those routes are still accepted while adoption grows.</p>
<figure>
    <img loading="lazy" src="/posts/running-your-own-autonomous-system/aspa-example.png"
         alt="ASPA path verification for AS219421 (MIARECKI-NET) and origin AS52025 (PARADOXNETWORKS-LIMITED) each attesting Provider&#43; toward transit AS6939 (HURRICANE), while AS6939 publishes no attestation, with min and max up-ramp and down-ramp spans"/> <figcaption>
            <p>ASPA path verification in action: both AS219421 and Paradox Networks (AS52025) list Hurricane Electric (AS6939) as an authorized provider.</p>
        </figcaption>
</figure>

<h3 id="signing-vs-verification">Signing vs. Verification</h3>
<p>Signing and verification are two completely separate steps. Just because you sign your ROAs and ASPA objects does not mean you, or other networks on the Internet, actually verify incoming routes; plenty of legacy ASes still do not.</p>
<p>The simplest way to start verifying RPKI ROAs on your router is pointing BIRD at a public RPKI RTR server, such as Cloudflare&rsquo;s (<code>rtr.rpki.cloudflare.com</code>, port <code>8282</code>). The catch is that plain RTR over the public Internet is unauthenticated (a path attacker could feed you bad data), you are delegating trust to someone else, and public RTR servers generally do not support ASPA, meaning if you want full control and ASPA validation, you need to <a href="/posts/running-your-own-autonomous-system/#self-hosting-your-rpki-and-aspa-validator">run your own validator</a>, as wired up in <a href="/posts/running-your-own-autonomous-system/#setting-up-your-first-bgp-session">the BIRD 3 config above</a>.</p>
<p>On top of RPKI and ASPA, always set max-prefix limits (<code>receive limit</code> in BIRD) on your BGP sessions: if a peer or route server accidentally dumps a full routing table when you only expect a handful of prefixes, a max-prefix limit warns or tears down the session before it exhausts your router&rsquo;s memory.</p>
<h3 id="manrs-and-packet-filtering">MANRS and packet filtering</h3>
<p>Control-plane BGP filters only protect your routing table; <a href="https://manrs.org/">MANRS</a> (Mutually Agreed Norms for Routing Security) also covers data-plane hygiene. Using <code>nftables</code>, that means enforcing anti-spoofing (BCP 38: only letting your own or valid customer source addresses leave your network), making sure you do not accidentally transit traffic between external peers (a routing-policy concern rather than blindly dropping legitimate asymmetric routing in the firewall), and keeping discovery chatter like DHCP or ZeroTier broadcasts off IXP peering LANs.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<h2 id="going-further">Going further</h2>
<p>Once your basic BGP setup is running cleanly, three upgrades make operating an AS much safer and easier to maintain:</p>
<h3 id="automating-irr-peer-filters-with-bgpq4">Automating IRR peer filters with <code>bgpq4</code></h3>
<p>Maintaining peer prefix lists by hand does not scale. Tools like <a href="https://github.com/bgp/bgpq4"><code>bgpq4</code></a> query IRR databases for each peer&rsquo;s <code>as-set</code> and generate BIRD prefix sets automatically on a schedule, so when a peer adds or removes a prefix your filters stay up to date without manual edits.</p>
<h3 id="self-hosting-your-rpki-and-aspa-validator">Self-hosting your RPKI and ASPA validator</h3>
<p>To stop delegating RPKI trust to a third party and unlock ASPA validation, you can host your own validator. In my testing, NLnet Labs&rsquo; <code>Routinator</code> used a lot of CPU and held nearly 3 GB of RAM resident, while OpenBSD&rsquo;s <code>rpki-client</code> paired with <code>rtrtr</code> (serving RTR v2 to BIRD) used noticeably less CPU, stayed around 200 MB of RAM at steady state, and synced roughly twice as fast.</p>
<h3 id="testing-before-you-deploy-and-practicing-first">Testing before you deploy (and practicing first)</h3>
<p>Before pushing filter or firewall changes to a live router, you can use tools like <a href="https://containerlab.dev/">Containerlab</a> (clab) to simulate a network locally. It spins up lightweight Linux containers running BIRD so you can test your routing policies, inject routes as if you were an upstream or a misbehaving peer, and verify that invalid ROAs, route leaks, or bad firewall rules get caught before anything touches the live Internet. A local lab will not reproduce every real-world upstream policy or quirk on the Internet, but it catches almost all self-inflicted config mistakes before they touch a live router.</p>
<figure>
    <img loading="lazy" src="/posts/running-your-own-autonomous-system/clab.png"
         alt="Containerlab topology graph showing simulated routers rtr-ams, rtr-fra, and rtr-tor wired to simulated transit upstreams, IXP route server rs-4ixp, bilateral peers, a downstream customer, a RIPE Atlas probe, and a bgp.tools route collector"/> <figcaption>
            <p>My local Containerlab topology graph, simulating routers, transit upstreams, an IXP route server, peers, a downstream customer, and a route collector before deploying changes.</p>
        </figcaption>
</figure>

<p>And if you want to learn all of this first without paying for an ASN, dealing with LIR paperwork, or risking real Internet routes, check out <a href="https://dn42.dev/">DN42</a>. It is a community-run virtual overlay network that uses the exact same tools (BIRD, WireGuard, BGP, ROAs, Looking Glasses) so you can experiment without breaking anything real.</p>
<h2 id="nogs-and-further-reading">NOGs and further reading</h2>
<p>Running an Autonomous System is a lot easier when you plug into the operator community. Around the world, Network Operators Groups (NOGs) bring network engineers together through conferences, chat rooms, and mailing lists to share operational lessons, peering contacts, and best practices, like <a href="https://www.denog.de/">DENOG</a> in Germany or <a href="https://nlnog.net/">NLNOG</a> in the Netherlands, alongside the wider <a href="https://www.ripe.net/community/">RIPE Community</a> and RIPE NCC&rsquo;s <a href="https://www.ripe.net/meetings/regional-meetings/">Regional Meetings</a>.</p>
<p>Good reference guides to read before putting production filters online are the <a href="https://routing.denog.de/">DENOG Routing Guide</a>, the <a href="https://bgpfilterguide.nlnog.net/">NLNOG BGP Filter Guide</a> (for concrete BGP filter templates and best practices), and the <a href="https://manrs.org/netops/guide/">MANRS Implementation Guide</a> (covering filtering, anti-spoofing, and validation).</p>
<h2 id="giving-back-to-the-community">Giving back to the community</h2>
<p>Once your AS is online and filtered cleanly, even a tiny network can contribute something useful back to the wider Internet. You can host a <a href="https://atlas.ripe.net/">RIPE Atlas</a> software probe to give operators and researchers another measurement vantage point, or run an <a href="https://www.as112.net/">AS112</a> DNS sinkhole node to absorb misdirected reverse-DNS lookups for private IP addresses locally.</p>
<hr>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Watch out for one Docker quirk if you run <code>bird-lgproxy</code>: bind-mount the parent <code>/run/bird</code> directory instead of <code>/run/bird/bird.ctl</code> directly. If the server reboots and Docker starts before BIRD creates the socket, Docker will create <code>/run/bird/bird.ctl</code> as an empty directory and BIRD will fail to start.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>Avoid turning strict reverse-path filtering (uRPF) on for upstreams or IXP interfaces. Linux only installs the single best route per prefix into the forwarding table, so legitimate asymmetric traffic (leaving via one provider and returning via another) gets dropped.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item></channel></rss>