#!/bin/bash
set -e
RULESET="define test1 = @y
table ip x {
set y {
type ipv4_addr
flags dynamic,timeout
}
chain z {
type filter hook input priority filter; policy accept;
add \$test1 { ip saddr }
update \$test1 { ip saddr timeout 30s }
ip saddr \$test1
}
}"
$NFT -f - <<< "$RULESET"