Skip to content

ivanitskiy/ebpf-fw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 <your IP>

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

Here is how to use it:

Options:
  -i, --iface <IFACE>            [default: enp0s3]
  -s, --source-ips <SOURCE_IPS>
  -p, --port <PORT>
  -h, --help                     Print help

About

A simple demo of building a network firewall with eBPF

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages