1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/bash # make sure stored delete/replace rule commands are correctly applied set -e $NFT -f - <<EOF flush ruleset table x { chain y { accept log } } EOF $NFT -f - <<EOF replace rule x y handle 2 log delete rule x y handle 3 add rule x y index 0 drop EOF