2026-09-09 20:59:40 +03:00
|
|
|
#!/usr/sbin/nft -f
|
|
|
|
|
flush ruleset
|
|
|
|
|
|
|
|
|
|
table inet nat {
|
2026-09-10 17:25:09 +03:00
|
|
|
{% 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 %}
|
2026-09-09 20:59:40 +03:00
|
|
|
chain postrouting {
|
|
|
|
|
type nat hook postrouting priority srcnat; policy accept;
|
|
|
|
|
oifname "{{ ext_iface }}" masquerade
|
|
|
|
|
}
|
|
|
|
|
}
|