CentOS7出现Unit iptables.service could not be found


CentOS7默认的防火墙不是iptables,而是firewalle.

出现此情况可能是iptables防火墙未安装。

#停止firewalld服务

systemctl stop firewalld

#禁用firewalld服务

systemctl mask firewalld

开启

systemctl unmask firewalld

安装iptables-services:

yum install iptables-services

设置开机启动:

systemctl enable iptables

systemctl [stop|start|restart] iptables
#or
service iptables [stop|start|restart]

service iptables save
#or
/usr/libexec/iptables/iptables.init save

然后

service iptables status

开启: service iptables start

关闭: service iptables stop


免责声明!

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



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