Build the lab yourself
The IRRd replies and bgpq4 output in this lesson come from a local IRRd 4.5 with this lesson's objects loaded, plus the extra objects below for AS64501's customer cone. The real registries don't hold documentation ASNs, so a local copy is the only way to query them. It's also a good way to test filter automation without touching a production IRR.
# A local IRRd 4 with the lesson's objects. Put the lesson's .rpsl files and lab-extra-objects.rpsl in ./data, then:
# docker compose up -d --build
# docker compose exec irrd sh -c 'for f in /data/*.rpsl; do cat $f; echo; done > /data/lab.db; irrd_database_upgrade --config /etc/irrd.yaml'
# docker compose exec irrd irrd_load_database --config /etc/irrd.yaml --source RIPE /data/lab.db
# docker compose exec -d irrd irrd --config /etc/irrd.yaml --foreground
# Queries: docker compose exec irrd sh -c "echo '!gAS64500' | nc irrd 43" and bgpq4 -h irrd ...
name: irrd-lab
services:
postgres:
image: postgres:16
environment: { POSTGRES_USER: irrd, POSTGRES_PASSWORD: irrd, POSTGRES_DB: irrd }
redis:
image: redis:7
irrd:
build:
dockerfile_inline: |
FROM python:3.11-slim-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends bgpq4 netcat-openbsd whois build-essential libpq-dev \
&& pip install irrd==4.5.3 && useradd -r irrd && mkdir -p /var/run/irrd /root/gnupg && chown irrd:irrd /var/run/irrd
CMD ["sleep", "infinity"]
hostname: irrd
volumes: ["./lab-irrd.yaml:/etc/irrd.yaml:ro", "./data:/data"]
depends_on: [postgres, redis]- Lines 1–6: Load the objects, start IRRd, and query it.
- Lines 9–13: IRRd stores objects in PostgreSQL and uses Redis between its processes.
- Lines 14–23: IRRd itself, plus bgpq4 and whois in the same container. IRRd refuses to run as root, hence the
irrduser.
irrd:
database_url: 'postgresql://irrd:irrd@postgres/irrd'
redis_url: 'redis://redis'
piddir: /var/run/irrd
user: irrd
group: irrd
server:
whois:
interface: '0.0.0.0'
port: 43
max_connections: 5
http:
interface: '0.0.0.0'
port: 8080
url: 'http://irrd.example.net/'
auth:
gnupg_keyring: /root/gnupg
override_password: '$1$J6KycItM$MbPaBU6iFSGFV299Rk7Di0'
set_creation:
COMMON:
prefix_required: false
password_hashers:
md5-pw: legacy
email:
from: irrd@example.net
smtp: localhost
sources_default: [RIPE]
sources:
RIPE:
authoritative: false
keep_journal: false- Lines 7–11: The whois port that the
!queries, whois and bgpq4 use. - Lines 27–31: One source, named RIPE to match the objects'
source:lines. Loaded from a file, not mirrored.
as-set: AS64501:AS-CUSTOMERS
descr: AS64501 and its customers
members: AS64501, AS64502, AS64503
mnt-by: CUST-MNT
source: RIPE
aut-num: AS64504
as-name: LATE-JOINER
member-of: AS64500:AS-CUSTOMERS
mnt-by: EXAMPLE-MNT
source: RIPE
route: 203.0.113.0/24
origin: AS64501
mnt-by: CUST-MNT
source: RIPE
route: 192.0.2.0/25
origin: AS64502
mnt-by: CUST-MNT
source: RIPE
route: 192.0.2.128/25
origin: AS64503
mnt-by: CUST-MNT
source: RIPE
route6: 2001:db8:501::/48
origin: AS64501
mnt-by: CUST-MNT
source: RIPE
mntner: CUST-MNT
admin-c: EX123-RIPE
upd-to: noc@example.net
auth: SSO noc@example.net
mnt-by: CUST-MNT
source: RIPE- Lines 1–5: The set that AS64500's set includes.
- Lines 7–11: AS64504 joins AS64500:AS-CUSTOMERS by reference, allowed by the set's mbrs-by-ref.
- Lines 13–38: Route objects for the cone, and the customers' maintainer.
Where next
- RPKI and Route Origin ValidationBuilds on this lesson · Intermediate · 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.
- BGP FundamentalsPrerequisite · 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.