Unit iptables.service could not be found


问题:查看防火墙状态时报错service iptables status

解决方案

  在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理,当然你可以还原传统的管理方式,或则使用新的命令进行管理。本文中将还原传统的管理方式。

  cd /etc/sysconfig

  ls -l

  没有查看到iptables文件,但存在ip6tables-config和iptables-config,本文中的linux为CentOS 7.6 ,CentOS 7默认没有了iptables文件。

  安装iptables-services yum install iptables-services

  启动iptables systemctl enable iptables

        systemctl start iptables

  查看防火墙状态service iptables status

  关闭防火墙 service iptables stop


免责声明!

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



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