1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/bash set -e RULESET="define test = { 1.1.1.1 } table ip x { set y { type ipv4_addr elements = { 2.2.2.2, \$test } } set z { type ipv4_addr elements = { 3.3.3.3, \$test } } }" $NFT -f - <<< "$RULESET"