如何用经典的iptables替换firewalld防火墙

centos7 开始,firewalld已经替代了经典的iptables服务。
什么是firewalld呢,同样的软件防火墙服务。 但是更高级,动态的防火墙技术,可以对网络链接或者网卡接口定义不同的信任级别区域。
具体的介绍:
https://fedoraproject.org/wiki/FirewallD

那么如果我们还是使用经典的静态防火墙规则配置服务就可以,如何替换为iptables呢?

1. 首先我们要安装对应的服务软件包
yum install iptables-service

2. 换回我们需要的iptables 服务
systemctl mask firewalld
systemctl enable iptables
systemctl enable ip6tables.service

3. 关闭 firewalld 服务,开启iptables 服务。

systemctl stop firewalld
systemctl start iptables
systemctl start ip6tables

此篇文章已被阅读2629 次

Add a Comment

邮箱地址不会被公开。 必填项已用*标注