iptables防火墙可以说是非常强大的,所以使用Linux的话iptables是必不可少的,但是有些Linux发行版默认防火墙并不是iptables的,为了更好的使用iptables最好是关闭原有的默认防火墙再启用iptables,这样可以减少一定的风险。
今天就以常用的CentOS7系统为例,默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。
1、关闭firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

2、安装iptables
先检查是否安装了iptables
# service iptables status
安装iptables
# yum install -y iptables
升级iptables
# yum update iptables
安装iptables-services
# yum install iptables-services
3、iptables的一些操作技巧可以参考以下这篇文章
https://www.ahaoyw.com/article/44.html

