CentOS 7 中安装iptables启动时Job for iptables.service failed because the control process exited with error

#安装iptables 
yum install iptables-services

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

iptables -A OUTPUT -p tcp --sport 3322 -j ACCEPT

 

#重启防火墙使配置文件生效 
systemctl restart iptables.service

#设置iptables防火墙为开机启动项 
systemctl enable iptables.service

③关闭SELINUX 
 vi /etc/selinux/config 
 #注释以下配置 
 SELINUX=enforcing 
 SELINUXTYPE=targeted 
  
 #增加以下配置 
 SELINUX=disabled 
  
 #使配置立即生效 
 setenforce 0

使用 curl kkwwo.com:80  测试端口号是否开启

你可能感兴趣的:(CentOS,7)