I have a running instance of iptables and ipset services. Among them one set has a spec similar to this that has 20+ references to it:
create_set foo ipmap --network 123.45.67.0/24
add_to_set foo host1
add_to_set foo host2
where host1 and 2 are say 123.45.67.5 and 123.45.67.6.
I need to add host3
to the set that is on a different subnet than 67, e.g., 123.45.66.0. I would like to enlarge the set foo
to 123.45.0.0/16
. The problem I am getting when trying to re-define foo
(no error) and add host3
(say 123.45.66.5) while it is running and then getting the "out of range" error from the ipset
command. It turns out ipset
does not reload sets with references.
Now all this is scripted with scripts and makefiles to keep the ipset and iptables services down as little as possible while updating either sets or the rules. There are hundreds of sets and rules saved and reloaded. Can I (and if yes, how) replace a running set by its enlarged version? It seems I can only do it by shutting down iptables and ipset, making my changes, and then reloading, but can't rebuild it on the fly; otherwise it complains the set specification is wrong when trying to add the host3
entry from another subnet. (There may be other hosts all over the place in 123.45.x.x added later on.)
This happens on EL5 and EL6 running either ipset 4.5 or 6.11.