FreeKB - firewalld firewall-cmd - allow or deny a service
firewalld firewall-cmd - allow or deny a service

Home > Search

If you are not familar with firewalld and the firewall-cmd, check out our Getting Started article.

The --add-service=service_name option can be used to allow connections to a certain service, such as SMTP.

firewall-cmd --zone=work --add-service=smtp --permanent
firewall-cmd --reload


Each service has an XML file located at /usr/lib/firewalld/services which contains the port and protocol being used by the service. For example, the ssh.xml file is using port 22 and the TCP protocol.

<?xml version="1.0" encoding="utf-8"?>
  <port protocol="tcp" port="22"/>


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 92cc4 in the box below so that we can be sure you are a human.