/ebpf-fun

XDP eBPF program with golang userspace - just for fun

Primary LanguageC

ebpf-fun

eBPF program using XDP for listing to incoming connection for given network interface. Example from cilium/ebpf helped this program to happen

Building

Building application requires libbpf-dev and other installation script for Ubuntu/Debian is provided in install.sh file

./install.sh

Building app

make

Usage

You can set on what network interface application should attach XDP program (default: eth0)

$ ./app -h    
Usage of ./app:
  -iface string
        Interface name to attach XDP program (default "eth0")

Running app requires root permissions

$ sudo ./app
2022/02/18 20:47:52 Listening for events..
Server listen on :8081
2022/02/18 20:47:55 New connection: 172.21.240.1:57621 -> 172.21.255.255:57621 

Running inside of a container (using docker-compose)

make up

Materials to check out