CentOS7启用iptables 停用firewalld

Red Hat Enterprice Linux(RHEL) 7,当然也包括 CentOS7 ,防火墙服务默认使用的是 firewalld,而不是 iptables。如果想改用 iptables,可以参考以下步骤。

安装 iptables

命令

yum install -y iptables-services

启用 iptables

命令:

systemctl mask firewalld
systemctl enable iptables

如果需要使用 ip6tables , 需另外加一行

systemctl enable ip6tables

停止firewalld服务,开启 iptables服务

命令:

systemctl stop firewalld
systemctl start iptables

同上,如果需要使用 ip6tables , 需另外加一行

systemctl start ip6tables

然后就可以像以前那样使用 iptable 啦!

Leave a Comment

豫ICP备19001387号-1