Simple firewall management tool that uses firewalld deamon

Install

yum install firewalld
systemctl start firewalld
systemctl enable firewalld
firewall-cmd --state

List all zones

firewall-cmd --list-all

Rule management

# add default http port to public zone
firewall-cmd --zone=public --add-service=http
# add a port with protocol to public zone
firewall-cmd --zone=public --add-port=18443/tcp
# add a port with protocol to trusted zone
firewall-cmd --zone=trusted --add-port=27017/tcp
# add permanently a rule
firewall-cmd --permanent --zone=public --add-service=http
# black list a spam IP
firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='92.118.38.58' reject"
# remove a rule permanently
firewall-cmd --permanent --remove-port=444/tcp

Categories: Server

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.