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.

One Response to Centos 7 – firewall-cmd usefull commands

  1. amir john says:

    great piece of information , thanks for sharing

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.