前言
在最新版的CentOS 7中,系统安装了两个防火墙firewalld和iptables,并且默认使用firewalld。由于之前版本均使用iptables,因此如下主要以iptables为例。
切换至iptables
在正式使用iptables之前,需要将默认使用的firewalld停止,并让系统将iptables作为默认防火墙。其命令如下:
#关闭并禁用firewalld
systemctl stop firewalld
systemctl disable firewalld
#启动并启用iptables
systemctl start iptables
systemctl enable iptables
#如果使用了IPv6,还需要开启ip6tables
#启动并启用ip6tables
systemctl start ip6tables
systemctl enable ip6tables
未完,持续更新.......