Centos8 运行service iptables status 时报错!

[root@dsjdasdjs]# service iptable status

Redirecting to /bin/systemctl status iptable.service

Unit iptable.service could not be found. 如下图:

 

Centos8默认防火墙是firewalld,而不是iptables

解决方法如下 :

yum install iptables-services  

service 方式操作

service iptables stop     //停止防火墙---即时生效

service iptables start    //启动防火墙---即时生效

service iptables restart    //重启防火墙

chkconfig iptables off     //永久关闭防火墙

chkconfig iptables on   //永久关闭后重启 

建议:

systemctl status firewalld    //查看防火墙状态

systemctl start firewalld    //启动firewall

systemctl stop firewalld    //停止firewall

systemctl disable firewalld    //禁止firewall开机启动

systemctl enable firewalld    //开机启动

posted @ 2021-12-08 10:49  Aqufish  阅读(641)  评论(0)    收藏  举报