A simple way to mass whitelist incoming traffic from specific ip addresses (Currently only made for FirewallD).
I needed a way to mass-whitelist incoming traffic from IPs on a specific port from Cloudflare (https://www.cloudflare.com/ips/), TCPShield (https://tcpshield.com/v4-cf/) and so on and I was to lazy to copy and paste the ips myself.
Requirements
- FirewallD
Installation guide:
- Install the required packages:
Debian based systems: sudo apt update -y && sudo apt upgrade -y && sudo apt install firewalld git -y
RHEL based systems: sudo dnf update -y && sudo dnf upgrade -y && sudo dnf install firewalld git -y
Optional (Depending on your firewall configuration): Allow incoming traffic on ssh via firewall-cmd --zone=public --permanent --add-port=22/tcp && firewall-cmd --reload
- Enable the service and start it:
systemctl enable --now firewalld && systemctl start firewalld
- Clone the repository:
git clone https://github.com/VexoDev/firewaller
- Go into its directory:
cd firewaller
- Run
chmod +X firewalld.sh
- Start using script via
./firewalld.sh