I'm working on a Soekris net4801 that is running an unknown distro of Linux. The kernel is 2.4.29, and iptables is v1.3.4.

I can't work out how to save the iptables. I searched the whole system for files/folders containing the name "iptables" and got 3 results:

/user/local/lib/iptables
/sbin/iptables
/lib/iptables

I've tried iptables save, iptables-save and iptables save active.

  • "iptables save" and "iptables save active" give me an invalid argument error.
  • "iptables-save" isn't a valid command.
  • "iptables --help" gives me a list of valid switches, none of which have to do with saving.

Any ideas on how I can save the iptables?

link|improve this question
feedback

1 Answer

Usually you create a script (like this) that first clears all rules and then creates the rules.

These save commands were added later. I personally don't like them: you can't script.

Usually you add the script to the /etc/init.d dir. The script in the example is already an init-script. Then you have to add links to /etc/rcX.d. If you happen to have a debian-based distro the command update-rc.d will do that for you. Otherwise read this, it's the most distro-independent description I found.

Or google about rc.d and run levels.

link|improve this answer
Okay, so I'd need to create a script to re-write all the values currently in the tables? How do I make sure that my additions are loaded on reboot? All of the current entries seem to be static, but my additions disappear on reboot. – Mike Morris Apr 15 '11 at 16:57
-> I edited the answer – Ganwell Apr 15 '11 at 23:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.