Now Available — Open Source

AutomatedAutomated
DDoS MitigationDDoS Mitigation

A BGP FlowSpec policy daemon that bridges the gap between attack detection and router enforcement, announcing through rustbgpd over gRPC. Built in Rust.

$docker compose --profile rustbgpd up -d --pull always --no-build

Bridge the gap between
detection and enforcement

You have detectors that know when you're under attack. You have routers that can filter at line rate. prefixd connects them.

Detector → Router
Without

Manual CLI or fragile scripts

With prefixd

Automated policy engine

Response time
Without

Minutes (operator intervention)

With prefixd

Seconds (API-driven)

Safety
Without

Easy to fat-finger, no guardrails

With prefixd

Quotas, safelist, /32-only, TTLs

Visibility
Without

Scattered logs, no audit trail

With prefixd

Dashboard, metrics, audit log

Expiry
Without

Forget to remove rules

With prefixd

Auto-expire via TTL

Key idea: Detectors signal intent, prefixd decides policy. No detector ever speaks BGP directly.

How it works

From detection to mitigation in seconds, not minutes

DetectorFastNetMon, Kentik, etc.
prefixdPolicy Engine
rustbgpdBGP speaker (gRPC)
RoutersLine-rate filtering

Policy Engine

YAML playbooks define per-vector responses with police or discard actions

Guardrails

Quotas, safelist, IPv4 /32 and IPv6 /128 host routes, mandatory TTLs

Reconciliation

Auto-expires mitigations, repairs RIB drift, fail-open design

Attack Detected

High-volume traffic from multiple sources

Mitigation Applied

FlowSpec rules deployed to edge routers

Pairs with rustbgpd

prefixd decides what to mitigate; rustbgpd, an API-first BGP daemon in Rust, owns the BGP sessions. prefixd drives it over typed gRPC calls, and the rustbgpd Compose profile is the default path. GoBGP stays maintained and selectable.

Explore rustbgpd

Features

Everything you need for production DDoS mitigation

Signal Ingestion

HTTP API accepts attack events from any detector

Policy Engine

YAML playbooks define per-vector responses

Guardrails

Quotas, safelist, IPv4 /32 and IPv6 /128 host routes

BGP FlowSpec

Announces through rustbgpd over gRPC, or GoBGP, with police & discard

Reconciliation

Auto-expires mitigations, repairs RIB drift

Dashboard

Real-time web UI with WebSocket updates

Authentication

Three roles: admin, operator, viewer

Observability

Prometheus metrics, structured logs, audit trail

Router Compatibility

Juniper
Junos Evolved: verified with GoBGP
Arista
EOS 4.33: partial, with GoBGP
FRR
Control plane, both speakers in CI
Cisco & Nokia
IOS-XR, SR OS: expected, untested

FRR receiving prefixd's FlowSpec rules is control-plane evidence, not router enforcement. Requalify your router software, address family and action; see the vendor reference.

Language
Rust 1.89+
Memory safe & fast
Protocol
BGP FlowSpec
RFC 5575 compliant
License
MIT
Open Source
Quick Start

Get started in under a minute

Four steps to a local stack with rustbgpd, from published images

1

Clone the repository

git clone https://github.com/lance0/prefixd.git
cd prefixd
2

Start the rustbgpd profile

docker compose --profile rustbgpd up -d --pull always --no-build
3

Create admin account

docker compose exec prefixd-rustbgpd prefixdctl operators create \
  --username admin --role admin
4

Open the dashboard

open http://localhost

Running services

ServicePurposePorts
nginxDashboard and API80
prefixd-rustbgpdPolicy controllerinternal
rustbgpdBGP speaker, gRPC on a private socket179
dashboardWeb UIinternal
postgresState storageinternal
prometheus, grafanaMetrics (host loopback)9091, 3001

The sample peer uses a documentation address and stays Idle until you configure your edge router in configs/rustbgpd.toml.

Prefer GoBGP? Start a fresh deployment with the GoBGP profile:

docker compose --profile gobgp up -d --pull always --no-build

Run controller commands in prefixd-gobgp, and run one profile at a time.

Ready to protect your network?

View Documentation