Today I learned: How to add port 80 and 443 to Firewalld

Firstly we need to find the active zones of Firewalld

sudo firewall-cmd --get-active-zones

Then we execute the commands to add the services permanently then we reload:

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --zone=public --add-service=https --permanent
sudo firewall-cmd --reload

We may also do it in such a manner:

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --reload

Leave a comment