netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ip(6)tables-save: Allow chain selection
@ 2011-10-01 15:19 Richard Weinberger
  2011-10-01 15:19 ` [PATCH 1/2] iptables-save: " Richard Weinberger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Richard Weinberger @ 2011-10-01 15:19 UTC (permalink / raw)
  To: netfilter-devel

This patch set adds a switch to iptables-save to select
a specific chain to be saved.

Sometimes it's useful to save only one chain.
E.g. When some rules are added dynamically by daemons like
OpenVPN or strongSwan and the base rule set is generated by
a bash script.

Consider this trivial script:
---8<---
#!/bin/sh

# save only the DYN_OVPN chain
iptables-save -t filter -C DYN_OVPN > /tmp/dyn-rules

iptables -F
iptables -X

iptables -A INPUT -s 1.2.3.4 -j ACCEPT
# much more rules...
iptables -A INPUT ... -j ACCEPT

# OpenVPN can insert here rules which get not lost in case
# the base rule set gets modified and reloaded.
iptables -N DYN_OVPN
iptables -A INPUT -i tun+ -j DYN_OVPN

# restore DYN_OVPN chain
iptables-restore -n < /tmp/dyn-rules
rm -f /tmp/dyn-rules
--->8---

[PATCH 1/2] iptables-save: Allow chain selection
[PATCH 2/2] ip6tables-save: Allow chain selection

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-01 19:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-01 15:19 ip(6)tables-save: Allow chain selection Richard Weinberger
2011-10-01 15:19 ` [PATCH 1/2] iptables-save: " Richard Weinberger
2011-10-01 15:19 ` [PATCH 2/2] ip6tables-save: " Richard Weinberger
2011-10-01 19:13 ` ip(6)tables-save: " Jan Engelhardt
2011-10-01 19:21   ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).