Unfortunately, this isn't as easy as it seems.  iptables save/restore
have very different semantics from ipset save/restore.  iptables starts
from an empty state and loads the specified rules.  ipset on the other
hand starts from the *CURRENT* state.  At system boot time, this will be
empty, so you will need to create ipsets and then populate them.
Loading new rules errors out if you try to create a  set that exists,
destroy a set that either doesn't exist or is referenced by iptables,
swap sets with one that doesn't exist, or rename to one that does exist.

The right solution feels like making it like iptables restore where it
populates rules and then swaps them into place, or changing semantics so
that you have things like "destroy if exists" and have "save" emit that.
Or "swap or rename" so that you could populate rules and then put them
in place.

My current plan is to make an /etc/ipset.d directory, and have files in
there that do the delete or create and ignore them if they already
exist.  One file for each rule to make a known state, then the file that
loads from the known state.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1405670

Title:
  iptables-persistent lacks support for ipset

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/iptables-persistent/+bug/1405670/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to