SailFirewall

Linux firewall powered by eBPF and XDP

Requirements

  • Go 1.16+
  • Linux Kernel 4.15+

Support feature

  • IPV4
  • TCP

Please contribute other protocols support

Usage

make
# change lo if you need
sudo ./SailFirewall -iface lo

API

Add rule

POST /api/v1/rule

{
    "SrcAddr": "127.0.0.1",
    "DstPort": 8000,
    "Proto": 6
}

Proto 6 is TCP

Get rule

GET /api/v1/rule

{
    "SrcAddr": "127.0.0.1",
    "DstPort": 8000,
    "Proto": 6
}

Delete rule

DELETE /api/v1/rule

{
  "SrcAddr": "127.0.0.1",
  "DstPort": 8000,
  "Proto": 6
}

Reference

EtherType

IP protocol numbers

TCP

GitHub

View Github