
XDP Based Lightweight and Fast Firewall
Siper is a high-performance, XDP-based IP blacklist firewall built with Go and C (eBPF). It allows you to drop malicious traffic at the earliest possible stage in the Linux networking stack—the network driver level. By leveraging XDP (Express Data Path), Siper processes packets before they even reach the kernel's heavy networking subsystem, providing extreme performance even under heavy DDoS conditions.
XDP-Powered Performance: Packet filtering happens at the NIC driver level using XDP_DROP, resulting in significantly lower CPU overhead compared to iptables or nftables.
LPM (Longest Prefix Match): Supports CIDR-based blocking (e.g., 192.168.1.0/24) using specialized BPF LPM Trie maps for efficient IP range lookups.
Persistent Configuration: Rules are managed via a local JSON-based blacklist, allowing for easy auditing and versioning of blocked addresses.
Real-time Observability: Built-in metrics to track packet and byte counters for both dropped and passed traffic.
Minimalist Architecture: A compiled BPF object handles the data plane, while a Go-based CLI manages the control plane.
Siper operates on the principle of separating the Control Plane (User-space) from the Data Plane (Kernel-space).
Ingress: A packet arrives at the network interface.
Lookup: The XDP program intercepts the packet and performs a lookup in the block_list map.
Verdict:
Prerequisites
make
Move to build/ directory
Add or remove IP ranges from your local configuration file:
# Add a CIDR to the list
sudo ./siper add --cidr 1.2.3.0/24 --comment "Known botnet"
# Delete a rule
sudo ./siper del --cidr 1.2.3.0/24
Attach the firewall to a specific network interface:
# Start the firewall
sudo ./siper run --iface eth0 --path ./blacklist.json
# Stop and detach the firewall
sudo ./siper stop --iface eth0
View what is happening inside the kernel:
# See currently active keys in the BPF map
sudo ./siper dump-keys
# Monitor drop/pass statistics
sudo ./siper dump-metrics
Pull requests are welcome. For bug fixes and small improvements, please submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is free software; you can redistribute it and/or modify it under the terms of the GPLv3 license. See LICENSE for details.