Today we’ll look at firewall configuration on CentOS / RedHat by using firewalld, the replacement for iptables. Since they are both mutually exclusive, if you decide to use firewalld, ensure that iptables is not running and cannot be started, by masking the service with systemctl mask iptables
With firewalld, traffic is classified into zones that can have their own rules and ports / services. The default zone is called the public zone
Now let’s see a couple of commands for accomplishing various tasks.
list the predefined zones
12
firewall-cmd --get-zones
work drop internal external trusted home dmz public block
print the default zone
12
firewall-cmd --get-default-zone
public
list active zones and their interfaces
123
firewall-cmd --get-active-zones
public
interfaces: enp0s3
________________________________________
/ Your best consolation is the hope that \
| the things you failed to get weren't |
\ really worth having. /
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||