解决CentOS(6和7版本),/etc/sysconfig/下没有iptables的问题


一、Centos 6版本解决办法:

1.任意运行一条iptables防火墙规则配置命令:

iptables -P OUTPUT ACCEPT 

2.对iptables服务进行保存:

service iptables save  

3.重启iptables服务:

service iptables restart 

二、Centos 7版本解决办法:

1、停止并屏蔽firewalld服务

systemctl stop firewalld systemctl mask firewalld

2、安装iptables-services软件包

yum install iptables-services

3、在引导时启用iptables服务

systemctl enable iptables

4、启动iptables服务

systemctl start iptables

5、保存防火墙规则

service iptables save
或
/usr/libexec/iptables/iptables.init save


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM