Code Monkey home page Code Monkey logo

xdp-filter-py's Introduction

xdp-filter-py

Filter packets using xdp eBPF

Installation

Please follow bcc install step

Demo

> python3 xdp_filter.py -h
usage: xdp_filter.py [-h] --device DEVICE [--mode MODE] [--port PORT] [--ip IP] [--jitter JITTER]

Filter incoming packets on XDP layer.

optional arguments:
  -h, --help            show this help message and exit
  --device DEVICE, -d DEVICE
                        device
  --mode MODE, -m MODE  skb or driver mode.
  --port PORT, -p PORT  drop packets from certain port.
  --ip IP, -i IP        drop packets from certain ip.
  --jitter JITTER, -j JITTER
                        randomly drop packets. ( range: 0 ~ 100 )


> python3 xdp_filter.py -d ens5 -p 6379 # Drop all traffic to 6379 port

=== Printing drops with IP, hit CTRL+C to stop ===
10.20.14.216: 1
10.20.14.216: 2
10.20.14.216: 3
10.20.14.216: 4
10.20.14.216: 4
....

xdp-filter-py's People

Contributors

gtlim avatar

Watchers

James Cloos 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.