How to open firewall port on CentOS7

CentOS 7 is now using Firewalld instead of iptables, so the commands are different if you want to open a port:

1
2
3
4
5
6
# Open port
firewall-cmd --zone=public --add-port=8080/tcp --permanent
# Reload firewall
firewall-cmd --reload
# Use this command to check the active zones
firewall-cmd --get-active-zones