Giter Site home page Giter Site logo

ebpf-xdp's Introduction

ebpf-xdp

A packet filtering firewall developed with XDP (eXpress Data Path) technology.

Install

Step1: Setup dependencies

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

Step2: Pull source code

sudo git clone https://github.com/jieyugit/ebpf-xdp.git

Step3: Build and install

enter the root folder of project

cd ebpf-xdp

To build and install the library, run:

sudo ./configure
sudo make && make install

Step4: Run

./run.sh

Commands

# 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

CHANGE LOG

2023.11.18

  • Complete the writing of the command-line XDP firewall.

2023.12.13

  • fix some bugs

2023.12.14

  • update steps of install and run the program
  • Add run.sh to run the program automatically

2023.12.18

  • update format of rules

Reference

ebpf-xdp's People

Contributors

jieyugit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.