Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ivanitskiy/ebpf-fw
- Owner: ivanitskiy
- License: apache-2.0
- Created: 2023-12-12T17:30:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-15T18:23:49.000Z (about 1 year ago)
- Last Synced: 2024-10-28T02:07:25.664Z (about 2 months ago)
- Topics: demo, ebpf, firewall, poc, rust
- Language: Rust
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/ayaThis 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 onlyTo 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
```