#!/usr/sbin/nft -f flush ruleset table inet nat { {% if dnat_target_ip %} chain prerouting { type nat hook prerouting priority dstnat; policy accept; ip daddr {{ anycast_prefix.split('/')[0] }} dnat to {{ dnat_target_ip }} } {% endif %} chain postrouting { type nat hook postrouting priority srcnat; policy accept; oifname "{{ ext_iface }}" masquerade } }