Allow HTTP/s in Firewalld

You can allow and deny incoming traffic based on predefined services in firewalld. You can find the complete list of services in /etc/services file. Let’s allow HTTP and HTTPS service via the firewalld. The above rules will be removed after system reboot. Use the –permanent option to add rules permanent in firewalld. Next, run the following command to apply the changes:

Check Allowed Services

You can find the list of added services with the following command: You should see the results like:

Disable Services from Firewalld

If you want to remove/deny the above services from the firewalld, use the –remove-service option: Next, run the following command to apply the changes:

Conclusion

In this tutorial, you have learned to allow/deny services in firewalld via command line.