Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivanitskiy/ebpf-fw

A simple demo of building a network firewall with eBPF
https://github.com/ivanitskiy/ebpf-fw

demo ebpf firewall poc rust

Last synced: 8 days ago
JSON representation

A simple demo of building a network firewall with eBPF

Awesome Lists containing this project

README

        

# ebpf-fw
A simple demo of building a network firewall with eBPF with the help of https://github.com/aya-rs/aya

This demo loads `XDP` eBPF application and does a few things:
- parses Ethernet protocol
- if it is IPv6 - drop it
- if it is IPv4 - print SRC and DST for TCP or UDP only

To run it to drop all packets for 80 coming from `RUST_LOG=info cargo xtask run -- -i enp0s3 -p 80 -s `

The source of the eBPF program is here: [myapp/myapp-ebpf/src/main.rs](./myapp/myapp-ebpf/src/main.rs).

Here is how to use it:
```
Options:
-i, --iface [default: enp0s3]
-s, --source-ips
-p, --port
-h, --help Print help
```