Welcome BashBastion! A Bash script that touts itself as a foolproof firewall.
BashBastion! relies on lsof to monitor network activity. When you run the script for the first time, BashBastion! will walk you through setting your threshold for connections from a singular IP or subnet. From there, BashBastion! will block any IPs/subnets over the threshold.
nftables will be used if installed. Otherwise, iptables will be used (and installed if it’s not already).
Download BashBastion here.
Tested on: Ubuntu 24.04, Ubuntu 20.04, Debian 12, Debian 11, Alma 9, Alma 8, Rocky 9.