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 ]
看看天上,于是我去了满是风雪的地方