Getting started with FirewallD

By | 2016/06/12

Here is a quick how-to to enable a port or service with FirewallD!

Add or Remove Service

To add any various pre-defined services:

sudo firewall-cmd --add-sevice=ssh --permanent

Add many services at once:

sudo firewall-cmd --add-service={http,https,ssh} --permanent

To remove:

sudo firewall-cmd --remove-service=ssh --permanent

(To make a change temporary, leave off –permanent )

Add or Remove Port

To add a specific port:

sudo firewall-cmd --add-port=3325/tcp --permanent

To remove:

sudo firewall-cmd --remove-port=3325/tcp --permanent

Apply Changes

To apply changes:

sudo firewall-cmd --reload

Get firewall status

To get the current status of allowed services or ports:

sudo firewall-cmd --list-all


Leave a Reply

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

Notify me of followup comments via e-mail. You can also subscribe without commenting.