解決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