centos7默认是Firewall。
1.首先查看状态
firewall-cmd --state
2.关闭防火墙的命令
systemctl stop firewalld.service
3.关闭开机自动启动:
systemctl disable firewalld.service
配置iptables
1.iptables安装包下载地址:
http://mirrors.163.com/centos/7/os/x86_64/Packages/
https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
第一个失效了
2.下载这两个(64位的):
iptables-1.4.21-34.el7.x86_64.rpm
iptables-services-1.4.21-34.el7.x86_64.rpm
安装(这里直接安装可能会报错(错误:打开 iptables-1.4.21-35.el7.x86_64.rpm 失败: 没有那个文件或目录
[root@localhost ~]# rpm -Uvh iptables-devel-1.4.21-35.el7.x86_64.rpm
警告:iptables-devel-1.4.21-35.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
错误:依赖检测失败:
iptables(x86-64) = 1.4.21-35.el7 被 iptables-