Monday, October 19, 2015

Block a specific IP address through firewalld on CentOS

Block a specific IP address through firewalld on CentOS

# firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="1.2.3.4" reject'

# firewall-cmd --zone=public --list-all

To remove the rule:

# firewall-cmd --zone=public --remove-rich-rule='rule family="ipv4" source address="1.2.3.4" reject'

No comments: