Opening iptables firewall ports on CentOS 7

To list existing iptable config:

sudo iptables -L

To open ports, for example, 80, 8443 and 8080:

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

success

$ sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent

success

$ sudo firewall-cmd --zone=public --add-port=8443/tcp --permanent

success

 

Reload config with:

sudo firewall-cmd --reload

Done.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.