In CentOS 7 or RHEL 7 or Fedora, firewalls are managed by firewalld
Add
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent is permanent and expires after reboot without this parameter)
firewall-cmd --zone=public --add-port=1000-2000/tcp --permanent
Reload
firewall-cmd --reload
View
firewall-cmd --zone=public --query-port=80/tcp
Delete
firewall-cmd --zone=public --remove-port=80/tcp --permanent
Turn on Firewall
systemctl start firewalld.service
Turn off firewall
systemctl stop firewalld.service
View running status
firewall-cmd --state //running