Managing firewall on CentOs 8

Check the Status of the Firewall

sudo firewall-cmd --state

List All Firewall Rules

sudo firewall-cmd --list-all

Create a New Zone

firewall-cmd --permanent --new-zone=allowed

Add the Specific IP Address ( allowed ) to the New Zone

firewall-cmd --permanent --zone=allowed --add-source=<YOUR-SOURCE-IP>

Allow Traffic to Port 80 in the New Zone

firewall-cmd --permanent --zone=allowed --add-service=http

Block Traffic to Port 80 in the Default Zone

firewall-cmd --permanent --zone=public --remove-service=http

Reload firewall service

firewall-cmd --reload

Leave a Reply

12 − nine =