Most administrators are using to using the “service save” to save rules on RHEL5 and RHEL6 servers. With 7 and Red Hat Enterprise 7 (as well as more-recent versions of Fedora), this command is no longer enabled by default. Instead, Red Hat has enabled `firewalld` by default. To enable the old IPTABLES save mechanisms, just perform the following steps:

First, stop and mask the firewalld service:

systemctl stop firewalld
systemctl firewalld
systemctl mask firewalld

Next, the iptables-services package and enable the service to start at boot:

install iptables-services
systemctl enable iptables

Then, saving the firewall rules can be done using either of the following two commands:

service iptables save
/usr/libexec/iptables/iptables.init save

Or you can using this way

CentOS 7 is using FirewallD now!

Example:
firewall-cmd --zone=public --add-port=3000/tcp --permanent

reload rules:
firewall-cmd --reload

Print Friendly, PDF & Email

Comments

comments

Bài viết liên quan