FirewallD Cheat Sheet

From Gejoreuy
Jump to navigation Jump to search

How to List Services that Allowed

$ firewall-cmd --zone=public --list-services

How to List Ports that Allowed

$ firewall-cmd --zone=public --list-ports

How to Allow Services Open and Permanent (As Example HTTP)

$ firewall-cmd --zone=public --permanent --add-service=http/tcp
$ firewall-cmd --reload

How to Allow Ports Open and Permanent (As Example Port 5000 TCP)

$ firewall-cmd --zone=public --permanent --add-port=5000/tcp
$ firewall-cmd --reload

How to Disable Services and Permanent (As Example HTTP Service)

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

How to Dissable Ports and Permanent (As Example Port 5000 TCP)

$ firewall-cmd --zone=public --permanent--remove-port=5000/tcp
$ firewall-cmd --reload