This is a quick overview of some very basic firewalld related commands that can be run on Linux. With firewalld there is no need to remove iptables as it should be run along side it. All firewalld will do is provide us a much simpler command structure, ultimately anything applied in firewalld gets placed into iptables.
On more modern distros firewalld can be installed using the following command:
yum install firewalld
If it's already installed just ensure it's started using the commands in the next section.
To ensure it autostart on boot:
systemctl enable firewalld.service
Starting firewalld:
systemctl start firewalld.service
Stopping firewalld:
systemctl stop firewalld.service
Reloading firewalld:
systemctl reload firewalld.service
Allow a single port:
firewall-cmd --permanent --add-port=80/tcp
Allow a port range:
firewall-cmd --permanent --add-port=60000-61000/tcp
Recently applied rules can be activated bt reloading the firewalld ruleset with the following command:
firewall-cmd --reload