1.取消firewall的管理
systemctl stop firewalld
systemctl mask firewalld
2.安装iptables和iptables-services组件
- 有网
yum install -y iptables
yum install -y iptables-services
- 没网
http://mirrors.163.com/centos/7/os/x86_64/Packages/ 下载iptables和iptables-services安装包(x86_64)
创建文件件 mkdir /usr/iptable
授权文件件 chmod 777 /usr/iptable
将上面下载的软件包拷贝至/usr/iptable系统
sudo rpm -Uvh iptables-1.4.21-24.el7.x86_64.rpm
sudo rpm -Uvh iptables-services-1.4.21-24.el7.x86_64.rpm
查询安装情况 rpm -q iptables