错误信息如下:
[root]# service iptables start
Redirecting to /bin/systemctl start iptables.service
Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.
没有service命令 需要初始化service
安装iptables-services:
yum install iptables-services
安装完成就可以使用命令了。
iptables启动、关闭、保存:
systemctl [stop|start|restart] iptables
#or
service iptables [stop|start|restart]service iptables save
#or
/usr/libexec/iptables/iptables.init save也可以用传统方式:
systemctl stop firewalld
systemctl mask firewalld