Easy to use

This guide will demo how to add a service with firewall-cmd.

First, we like to add an HTTP service to the firewall, we could use below snippet:
firewall-cmd --zone=public --add-service=http
Also, we like to add an HTTPS service to the firewall, just like below:
firewall-cmd --zone=public --add-service=https
Then we need to apply above setting in the firewall, use below snippet:
firewall-cmd --reload
Finally, confirm that port or service was opened successfully:
firewall-cmd --list-all