Search code examples
fedoraiptables

how to save iptables changes in fedora 22


After every restart the changes I make to iptables are lost. I know now that I have to save the changes after making them, but every way of saving I tried so far doesn't work.

I tried the following :

/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)

I'm just a basic *nix user, so most of my knowledge is based on uncle Google and I cannot find more solutions at the moment. Any help would be appreciated.

I'm on Fedora 22 64-bit.


Solution

  • As Fedora uses firewalld in recent versions, you need to do it with firewalld commands. Take a look here

    If you insist to use iptables, you need to install iptables in order to use iptables-save and iptables-restore commands using dnf install iptables .