Network Configuration¶
This guide covers BIRD (BGP routing) and WireGuard (VPN) configuration management.
BIRD Configuration¶
BIRD is used for BGP routing on core, IXP, and VLT servers to announce AS215011 routes.
Configuration Files¶
BIRD configurations are located in networks/{hostname}/bird/
:
networks/
├── coreams01/
│ └── bird/
│ └── bird.conf
├── ixpams01/
│ └── bird/
│ ├── bird.conf
│ └── peerlab.conf # Optional
└── ...
Not Templated
BIRD configs are not Jinja2 templates. They are static files copied as-is to servers.
Update BIRD Configuration¶
-
Edit the configuration:
-
Sync to server:
This will prompt for your BECOME password (sudo password).
- Verify the change:
BIRD Playbook Details¶
The sync-bird
playbook (playbooks/sync-bird.yml
):
- Creates
/etc/bird
directory - Copies
bird.conf
fromnetworks/{hostname}/bird/
- Copies optional
peerlab.conf
if it exists - Copies systemd service file
- Reloads systemd daemon
- Reloads BIRD service
Target hosts: core
, ixp
, vlt
Common BIRD Operations¶
Check BIRD status:
View BGP sessions:
View routing table:
Reload BIRD configuration:
Restart BIRD service:
WireGuard Configuration¶
WireGuard VPN tunnels connect IXP servers to the core server.
Configuration Files¶
WireGuard configurations are in networks/{hostname}/wireguard/
:
networks/
├── coreams01/
│ └── wireguard/
│ ├── wg0.conf
│ └── wg1.conf
├── ixpams01/
│ └── wireguard/
│ ├── wg0.conf
│ └── wg1.conf
└── ...
Templated
WireGuard configs are Jinja2 templates and can use variables from inventory and secrets.
Update WireGuard Configuration¶
-
Edit the configuration:
-
Sync to server:
This will prompt for your BECOME password.
- Verify the tunnel:
WireGuard Playbook Details¶
The sync-wireguard
playbook (playbooks/sync-wireguard.yml
):
- Templates all files from
networks/{hostname}/wireguard/
- Copies to
/etc/wireguard/
on remote server - Restarts
wg-quick@wg0.service
- Restarts
wg-quick@wg1.service
Target hosts: core
, ixp
Common WireGuard Operations¶
Check tunnel status:
Restart WireGuard interface:
View WireGuard logs:
Test connectivity through tunnel:
Generate WireGuard Keys¶
To create new WireGuard keys:
# Generate private key
wg genkey
# Generate public key from private key
echo "<private_key>" | wg pubkey
Store the private key in secrets/secrets.yml
:
Add:
Use in config:
Network Topology¶
Core to IXP Tunnels¶
┌─────────────┐ ┌─────────────┐
│ coreams01 │◄──── WireGuard ────►│ ixpams01 │
│ (Core) │ Tunnel │ (IXP) │
└─────────────┘ └─────────────┘
│ │
│ Announces │ Peers with
│ 2a06:de00:50::/44 │ other ASes
│ │
└────────────────────────────────────┘
Traffic flows through AS215011
Prefix Announcements¶
- Core services:
2a06:de00:50::/44
- Announced by core to IXP servers
-
IXP servers propagate to Internet via BGP
-
Probing infrastructure:
2a0e:97c0:8a0::/44
- Announced by VLT servers
- Enables unicast/anycast measurements
Firewall Configuration¶
Docker Firewall Rules¶
By default, Docker networks are isolated. To allow external access:
ssh nxthdr@ams01.core.infra.nxthdr.dev
sudo ip6tables -I DOCKER-USER -d 2a06:de00:50:cafe:100::/80 -j ACCEPT
This allows traffic to the DMZ network.
Manual Configuration
This firewall rule is not managed by the infrastructure code and must be applied manually.
View Current Rules¶
Troubleshooting¶
BIRD Not Starting¶
Check logs:
Common issues:
- Syntax error in config: sudo bird -p -c /etc/bird/bird.conf
- Port already in use: sudo netstat -tulpn | grep 179
- Missing dependencies: sudo apt install bird2
WireGuard Tunnel Down¶
Check interface status:
Common issues:
- Firewall blocking UDP port: sudo ufw allow 51820/udp
- Incorrect endpoint: Check Endpoint
in config
- Key mismatch: Verify public/private key pairs
Restart tunnel:
BGP Session Not Establishing¶
Check BIRD logs:
Common issues: - Incorrect neighbor IP - AS number mismatch - Firewall blocking TCP port 179 - Peer not configured on remote side
Test connectivity:
Routes Not Propagating¶
Check export filters:
Verify static routes:
Check kernel routing table:
Best Practices¶
-
Test BIRD config syntax before deploying:
-
Monitor BGP sessions after changes:
-
Keep WireGuard keys secure in Ansible Vault
-
Document peering arrangements in comments
-
Use BGP communities for route tagging and filtering
-
Set up monitoring for tunnel and BGP session status
Next Steps¶
- Adding Services - Add new services
- Common Tasks - Day-to-day operations
- Architecture - Technical details