Centos 7 – firewall-cmd usefull commands

A short post to save some of the useful options for firewall-cmd:

List all the port opened by firewall-cmd

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

List all information

firewall-cmd --list-all

List services (be careful some services are opened but not listed in list-ports)

firewall-cmd --list-services

Remove a port or service

firewall-cmd --permanent --remove-port=8000/tcp
firewall-cmd --permanent --remove-service=http/tcp

Reload & commit change

firewall-cmd --reload

 

This entry was posted in Networks and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *