Is there a "best practice" or standard to make a few iptables rules permanent? I mean: automatically applied upon a system reboot?
I am using a VPS with Ubuntu Server 10.04 LTS (Lucid Lynx).
Thank you.
BIG EDIT: I don't want ANY rule to be persisted (like iptables-persistent
package does). I want only my own specific set to be reloaded... if other rules are eventually added by running iptables, these should be discarded...
iptables-save
once, and reload always (iptables-restore at /etc/rc.local sounds good). – J. Bruni Oct 15 '11 at 15:18permission denied
when you try to use>
then this Stack Overflow answer will be useful. – David Tuite Feb 13 '14 at 14:40sudo sh -c "iptables-save > /etc/iptables.conf"
instead ofsudo iptables-save > /etc/iptables.conf
– Rajat Gupta Mar 04 '14 at 13:17