ansible-edda/plays/vpn/roles/wireguard/templates/post-up-wg0-ipv4.nft.j2

13 lines
273 B
Plaintext
Raw Normal View History

2022-09-25 16:00:40 +02:00
#!/usr/bin/env -S nft -f
table ip wg0_ipv4 {
2022-12-09 01:16:00 +01:00
{% if vpn_wireguard_role == "server" %}
2022-09-25 16:00:40 +02:00
chain postrouting {
type nat hook postrouting priority 100;
2022-12-09 01:16:00 +01:00
iif wg0 oif {{ ansible_default_ipv4.interface }} masquerade;
2022-09-25 16:00:40 +02:00
}
2022-12-09 01:16:00 +01:00
{% endif %}
2022-09-25 16:00:40 +02:00
}