Getting Started
Verified against v0.6.0. Commands assume a Linux host with root access and a recent kernel that supports eBPF and XDP. The build needs Rust 1.85.0 or newer (edition 2024).
Prerequisites
- A Linux host (eBPF and XDP are Linux kernel features; bpfman does not run on macOS or Windows).
- Rust toolchain 1.85.0 or newer, from rustup.
sudoor root, since loading eBPF programs touches the kernel.- A network interface name to attach to (for example
eth0); check yours withip link.
Install
Clone the repository, build the workspace, and install the binaries and systemd unit with the bundled script.
git clone https://github.com/bpfman/bpfman.git
cd bpfman
cargo build
sudo ./scripts/setup.sh installcargo build compiles the bpfman CLI and the bpfman-rpc server. setup.sh install copies the binaries to /usr/sbin/ and installs the systemd service files (it prints the full list of steps when run).
A first working setup
This loads the prebuilt xdp_pass program from its OCI (Open Container Initiative) image, attaches it to an interface, and then removes it. Loading and attaching are two separate steps in v0.6.0: load returns a program id, and you pass that id to attach.
Load the bytecode image. This places the program in the kernel but does not attach it yet.
bashsudo bpfman load image --image-url quay.io/bpfman-bytecode/xdp_pass:latest \ --programs xdp:pass --application XdpPassProgramNote the program id printed by the previous command, then attach it to an interface. Replace
<PROGRAM_ID>with that id andeth0with your interface.bashsudo bpfman attach <PROGRAM_ID> xdp --iface eth0 --priority 35When finished, unload the program. This detaches it and removes it from the kernel.
bashsudo bpfman unload <PROGRAM_ID>
Verify it works
List the programs bpfman is managing and confirm yours appears under the application name you set.
sudo bpfman list programs --application XdpPassProgramYou should see a row for the loaded program with its id, type (xdp), and name. After unload, the same command should no longer list it.
Where to go next
For the gRPC server, Kubernetes operator and CRDs (Custom Resource Definitions), socket-activated privilege separation, and building your own bytecode images, see the official documentation at bpfman.io and the launch guide at Launching bpfman.