1.报错  

[root@localhost ~]# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

2.无法执行的原因是/etc/sysconfig/iptables 这个文件还没有生成呢。需要升级iptables。  

[root@localhost ~]# systemctl stop firewalld
systemctl stop 

[root@localhost ~]# yum install iptables-services.x86_64 
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
... ... 
Installed:
  iptables-services.x86_64 0:1.4.21-34.el7                                                              

Complete!

[root@localhost ~]# systemctl enable iptables Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.
[root@localhost
~]# systemctl start iptables [root@localhost ~]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

 

posted on 2020-09-27 18:32  星痕1216  阅读(287)  评论(0编辑  收藏  举报