Firewalld provides a dynamically managed firewall with support for network/firewall zones that define the trust level of network connections or interfaces. In this tutorial, we will cover how to set up a firewall for your centos server and show you the basics of managing the firewall.
Step 1 - Install and Enable Firewalld to Start at Boot
Login as root user and run the following command
yum install firewalld
systemctl enable firewalld
Allowing or denying an arbitrary port
firewall-cmd --zone=public --add-port=12345/tcp --permanent
firewall-cmd --zone=public --remove-port=12345/tcp --permanent
Reload firewalld so the rules take effect immediately
List all current rules
firewall-cmd --zone=public --list-all
0 Comments