A workaround that avoids deleting rules is providing rules.

# chain=OUTPUT
# iptables -Z $chain
iptables v1.8.2 (nf_tables): RULE_REPLACE failed (Invalid argument): rule in chain OUTPUT
# iptables -Z $chain 1
#

So, instead of `iptables -Z $chain` we could iterate over all existing rules and use e.g.

# iptables -L $chain -n --line-numbers | awk '$1+0>0 {print $1}' \
| xargs -rL1 iptables -Z $chain

--
-- Andreas

     :-)

Reply via email to