Hellfire
A Linux toy Firewall
Install / Use
/learn @xms0g/HellfireREADME
Hellfire: A Linux Toy Firewall based on Netfilter
Hellfire is a lightweight Linux firewall built upon the Netfilter framework, designed to filter TCP, SCTP, UDP, and ICMP packets in accordance with user-defined rules. You can use a command-line tool named hellfire to create the rules to control packet flow. Each rule generated is dispatched to the hellfire_core module. This kernel module then inserts a new entry into the policy table, enabling the comparison of incoming packets against user-defined rules. In cases where packet attributes correspond to a defined rule, the packet is subsequently dropped.
Features
Types of filtering rules:
Direction:Inbound or OutboundInterface:Inbound or OutboundSource:IP address, IP address range, MAC address, port numberDestination:IP address, IP address range, port numberProtocol:TCP, UDP, SCTP, ICMP
Prerequisites
Building
cd build
./builder.sh
Usage
Start
➜ sudo ./hellfire start
Stop
➜ sudo ./hellfire stop
ADD rules
➜ sudo ./hellfire -A INPUT -i enp0s8 -s 192.168.56.17 -p icmp -t DROP
➜ sudo ./hellfire -A INPUT -s 192.168.56.17 -p tcp --dst-port 80 -t DROP
➜ sudo ./hellfire -A INPUT --src-mac 08:00:27:27:ee:33 -t DROP
➜ sudo ./hellfire -A INPUT --src-ip-range 192.168.56.17:192.168.56.18 -t DROP
➜ sudo ./hellfire -A OUTPUT -d 192.168.56.17 -p icmp -t DROP
LIST rules
➜ sudo ./hellfire -L INPUT -p icmp
ID:1 DEST:INPUT IFN:(null) SRC:192.168.56.17 DPT:0 PRO:icmp TGT:DROP
DELETE rules
➜ sudo ./hellfire -D INPUT -n 1
FLUSH policy table
➜ sudo ./hellfire -F all
Flushed the policy table
Help
➜ sudo ./hellfire -h
Usage: hellfire [val | -<flag> [<val>] | --<name> [<val>] ]...
start Start firewall
stop Stop firewall
-A, --append Append policy[INPUT/OUTPUT]
-D, --delete Delete policy[INPUT/OUTPUT]
-L, --list List policies[INPUT/OUTPUT]
-F, --flush Delete all policies[all]
-n, --num Policy id(only with -L and -D option)
-i, --in-interface Name of an interface via which a packet was received (only for packets entering the INPUT)
-o, --out-interface Name of an interface via which a packet is going to be sent (only for packets entering OUTPUT)
--src-mac Source mac address(only for packets entering the INPUT)
-p, --protocol The protocol of the rule or of the packet to check
-s, --src-ip Source ip address(only for packets entering the INPUT)
--src-ip-range Source ip address range[ip:ip](only for packets entering the INPUT)
--src-port Source port address(only with -p option)
-d --dst-ip Destination ip address(only for packets entering OUTPUT)
--dst-ip-range Destination ip address range[ip:ip](only for packets entering the OUTPUT)
--dst-port Destination port address(only with -p option)
-t, --target A firewall rule specifies criteria for a packet[ACCEPT/DROP]
-h, --help Display usage information and exit
-v, --version Display version information and exit
Contribution
Contributions are welcome! Feel free to fork this repository, make improvements, and submit pull requests.
License
Hellfire is licensed under the GPL-2.0 License. See the LICENSE file for details.
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
