如何在 fedora 22 中保存 iptables 更改

how to save iptables changes in fedora 22

每次重新启动后,我对 iptables 所做的更改都会丢失。我现在知道我必须在做出更改后保存更改,但到目前为止我尝试过的所有保存方法都不起作用。

我尝试了以下方法:

/etc/init.d/iptables save (command not found)
/usr/libexec/iptables.init save (command not found)
/sbin/service iptables save (the service supports only basic lsb actions)

我只是一个基本的 *nix 用户,所以我的大部分知识都是基于叔叔 Google,目前我找不到更多的解决方案。任何帮助将不胜感激。

我正在使用 Fedora 22 64 位。

由于Fedora 在最近的版本中使用了firewalld,因此您需要使用firewalld 命令来完成。看看here

如果你坚持使用iptables,你需要安装iptables才能使用iptables-saveiptables-restore命令使用dnf install iptables