Skip to content

Security tool · 2026 · Open source

Packet-Filter Firewall

A multi-threaded packet-filtering firewall in pure C, built to understand defence at the packet level.

$ sudo ./firewall

[+] rule 3 block tcp 10.0.0.0/8 → :22

[!] rate limit 192.168.1.44 > 500 pps · blocked

[=] 48,211 packets · 312 dropped

[log] /var/log/firewall.log updated

❯

My role

Creator · sole developer

Shishir Ghimire

Overview

Allow and block rules by protocol, IP and port, CIDR subnet matching, automatic rate-limit blocking, BPF pre-filtering, live statistics and timestamped logs, with capture on its own thread.

The problem

Most people only meet firewalls as a GUI. I wanted to build one from raw packets up.

How we approached it

libpcap capture on a dedicated thread, a rule engine with CIDR matching, and kernel-level BPF filters to keep it fast.

What it does

  • CIDR subnet rules
  • Automatic rate-limit blocking
  • BPF kernel pre-filter
  • Live per-rule hit counters

Results

  • OutcomeHandles ICMP, TCP and UDP
  • OutcomeMenu stays responsive under load

More work

All projects

Secure channel open

Have a system to build, or one you want broken first?

Security engagements, CTF design, software for your business through Netanix Lab, or a role on your team. I reply within a day.