A packet filtering firewall developed with XDP (eXpress Data Path) technology.
For Ubuntu 22.04
sudo apt install -y libconfig-dev llvm clang libelf-dev build-essential libpcap-dev m4 gcc-multilib linux-tools-$(uname -r) linux-headers-$(uname -r) linux-tools-common linux-tools-generic libyaml-dev
sudo git clone https://github.com/jieyugit/ebpf-xdp.git
enter the root folder of project
cd ebpf-xdp
To build and install the library, run:
sudo ./configure
sudo make && make install
./run.sh
# unload ebpf program from interface
sudo ip link set dev ens33 xdp off
# check status of interface
ip link show dev ens33
# load ebpf program to interface
sudo ./xdp_prog_user -d ens33 --filename xdp_prog_kern.o --progname xdp_prog_main -S
# get the debug info
sudo cat /sys/kernel/debug/tracing/trace_pipe
-
Modify the rule, you can edit the file in
/src/config.yaml
-
If you have changed the code, you're excepted to build the source code, run:
$ cd src
$ pwd
./ebpf-xdp/src
$ make
- Complete the writing of the command-line XDP firewall.
- fix some bugs
- update steps of install and run the program
- Add
run.sh
to run the program automatically
- update format of rules
- xdp-project, xdp-tutorial
- gamemann, XDP-Firewall