Open and Close ports

To Open Ports

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload
systemctl restart firewalld
firewall-cmd --zone=public --list-ports

TO see the open ports

firewall-cmd --zone=public --list-ports

To close a port

firewall-cmd --zone=public --remove-port=10050/tcp
firewall-cmd --runtime-to-permanent
firewall-cmd --reload
systemctl restart firewalld

Was this helpful?

0 / 0