how to open port in CentOS

Old note from 2018-02-09. May be outdated.

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

# 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