Networking

    Bird2 BGP Routing Daemon

    Install and configure Bird2 on a RamNode VPS for BGP, OSPF, RIP, and BFD — including BYOIP and IPv6 support.

    Prerequisites

    • A RamNode VPS (any plan works; the $4/month KVM NVMe tier is sufficient for most use cases)
    • Root or sudo SSH access
    • Basic familiarity with Linux networking
    • An ASN and IP block if you plan to run BGP (optional for OSPF/RIP-only setups)
    1

    Update Your System

    Log in to your VPS and ensure all packages are current before installing Bird2.

    Update packages
    apt update && apt upgrade -y
    2

    Install Bird2

    Bird2 is available in the default repositories for Debian 12 and Ubuntu 22.04.

    Install Bird2
    apt install bird2 -y

    Verify the installation:

    Check version
    bird --version

    You should see output similar to BIRD version 2.x.x. The service starts automatically — check its status:

    Check service status
    systemctl status bird
    3

    Understand the Configuration Structure

    Bird2 uses a single configuration file located at /etc/bird/bird.conf. Unlike Bird 1.x, which had separate IPv4 and IPv6 daemons, Bird2 handles both address families in a unified process.

    The configuration is organized around three core concepts:

    • Protocols — define routing sources and sinks (BGP, OSPF, static routes, kernel routing table, etc.).
    • Tables — hold routing information. Bird2 has a built-in master4 table for IPv4 and master6 for IPv6.
    • Filters — functions written in Bird's filter language that control which routes are accepted or exported at each protocol boundary.
    4

    Write a Basic Configuration

    Back up the default configuration, then create your own:

    Backup and edit
    cp /etc/bird/bird.conf /etc/bird/bird.conf.bak
    nano /etc/bird/bird.conf

    Below is a minimal working configuration for a VPS that announces a static route over BGP to an upstream provider. Replace the placeholder values with your own ASN, IP addresses, and prefix.

    /etc/bird/bird.conf
    # /etc/bird/bird.conf
    
    # Router ID - typically your primary VPS IPv4 address
    router id 203.0.113.1;
    
    # Log to syslog
    log syslog all;
    
    # Kernel protocol - syncs Bird routes into the OS routing table
    protocol kernel {
        ipv4 {
            export all;
        };
    }
    
    # Device protocol - required to detect interfaces
    protocol device {}
    
    # Static route for your IP block
    protocol static {
        ipv4 {
            export all;
        };
        route 198.51.100.0/24 blackhole;
    }
    
    # BGP session with upstream provider
    protocol bgp upstream {
        local 203.0.113.1 as 65001;
        neighbor 203.0.113.254 as 65000;
    
        ipv4 {
            import none;
            export filter {
                if net = 198.51.100.0/24 then accept;
                reject;
            };
        };
    }
    5

    Validate and Apply the Configuration

    Bird2 includes a built-in syntax checker. Always validate before reloading:

    Validate config
    bird --parse-only -c /etc/bird/bird.conf

    A successful validation produces no output. If there are errors, the parser will print the line number and a description.

    Once validation passes, reload Bird2 without restarting the service (no session downtime):

    Hot reload
    birdc configure

    Or restart the service entirely if needed:

    Full restart
    systemctl restart bird
    6

    Use the Bird CLI

    The birdc command-line client connects to the running Bird2 daemon and lets you inspect state, run diagnostics, and reload configuration interactively.

    Show BGP sessions
    birdc show protocols
    Show routing table
    birdc show route
    Show BGP details for a peer
    birdc show protocols all upstream
    Show routes from a peer
    birdc show route protocol upstream
    Reload config without restart
    birdc configure
    7

    Add IPv6 Support

    Bird2 handles IPv6 natively. Add a parallel set of blocks to your configuration for ipv6:

    IPv6 configuration blocks
    protocol kernel {
        ipv4 { export all; };
        ipv6 { export all; };
    }
    
    protocol static {
        ipv4 { export all; };
        route 198.51.100.0/24 blackhole;
    
        ipv6 { export all; };
        route 2001:db8::/48 blackhole;
    }
    
    protocol bgp upstream6 {
        local 2001:db8::1 as 65001;
        neighbor 2001:db8::ffff as 65000;
    
        ipv6 {
            import none;
            export filter {
                if net = 2001:db8::/48 then accept;
                reject;
            };
        };
    }
    8

    Configure BFD for Faster Failover (Optional)

    BFD (Bidirectional Forwarding Detection) detects link failures in milliseconds, much faster than BGP hold timers alone. Enable it by adding a BFD protocol block and referencing it in your BGP session:

    BFD + BGP configuration
    protocol bfd {
        interface "*" {
            min rx interval 100ms;
            min tx interval 100ms;
        };
    }
    
    protocol bgp upstream {
        local 203.0.113.1 as 65001;
        neighbor 203.0.113.254 as 65000;
        bfd on;
    
        ipv4 {
            import none;
            export filter {
                if net = 198.51.100.0/24 then accept;
                reject;
            };
        };
    }
    9

    Harden Your Setup

    A few practices that matter for production Bird2 deployments on any VPS:

    Restrict the Bird control socket

    By default, birdc is accessible to root only. Verify socket permissions:

    Check socket permissions
    ls -la /run/bird/bird.ctl

    Use prefix filters to prevent route leaks

    Never export a full default-free zone to a peer unless you intend to act as a transit provider. Filter aggressively on both import and export.

    Set BGP timers conservatively for stability

    Conservative timers
    protocol bgp upstream {
        hold time 90;
        keepalive time 30;
        ...
    }

    Enable MD5 authentication if your upstream supports it

    MD5 authentication
    protocol bgp upstream {
        password "your-shared-secret";
        ...
    }
    10

    Enable Bird2 on Boot

    Bird2 should already be enabled at boot after installation, but confirm:

    Enable on boot
    systemctl enable bird

    Troubleshooting

    Bird fails to start after a config change

    Run bird --parse-only -c /etc/bird/bird.conf to locate the syntax error before attempting to restart.

    BGP session stays in Active state

    Check that the neighbor IP is reachable (ping), that port 179 is not blocked by a firewall, and that the remote AS number matches what your upstream expects.

    Routes not appearing in the OS routing table

    Ensure the kernel protocol block includes the correct address family with export all or an appropriate filter.

    birdc reports "Cannot connect to Bird socket"

    The daemon may not be running. Check systemctl status bird and review logs with journalctl -u bird.

    Next Steps

    With Bird2 running on your RamNode VPS, you can expand your setup to:

    • Run a full BGP route reflector for an internal network
    • Peer with route servers at an IXP
    • Combine Bird2 with WireGuard for an encrypted, routed mesh network
    • Use OSPF for multi-VPS dynamic routing across RamNode locations

    RamNode's KVM NVMe VPS plans give you full control over the network stack, making them well-suited for routing daemon workloads that require kernel-level IP management and persistent BGP sessions.