1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash # Variable containing anonymous map can be added to a snat rule set -e RULESET=' define m = {1.1.1.1 : 2.2.2.2} table nat { chain postrouting { snat ip saddr map $m } } ' $NFT -f - <<< "$RULESET"