Blog | Technical

Firewalld

Firewalld ban address

To ensure that firewalld is running on your server, run the following command. If firewalld is not running, go to the iptables section.

sudo systemctl status firewalld

Run the following command to block the IP address and to add the rule to the permanent set:

sudo firewall-cmd --permanent --add-rich-rule="rule family=`ipv4` source address=`xxx.xxx.xxx.xxx` reject"

Run the following command to reload the firewalld rules:

sudo firewall-cmd --reload

Run the following command to list and verify the new rule:

sudo firewall-cmd --list-all

https://docs.rackspace.com/support/how-to/block-an-ip-address-on-a-Linux-server/