add win_wg_spoke role

This commit is contained in:
Sergey Malyuk
2026-04-09 12:37:07 +03:00
parent af6fa9b3ac
commit 3cb1b7439e
10 changed files with 178 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
[Interface] # Local settings for this node
Address = {{ win_wg_spoke_ipv4_vpn }}/32
ListenPort = {{ win_wg_spoke_port }}
PrivateKey = {{ win_wg_spoke_pkey }}
{% if win_wg_spoke_dns_server is defined and win_wg_spoke_domain is defined %}
PostUp = powershell.exe -Command "& { Add-DnsClientNrptRule -Comment '{{ win_wg_spoke_iface_name }}-wg' -Namespace '.{{ win_wg_spoke_domain }}' -NameServers {{ win_wg_spoke_dns_server }} }"
PostDown = powershell.exe -Command "& { Get-DnsClientNrptRule | where Comment -eq '{{ win_wg_spoke_iface_name }}-wg' | foreach { Remove-DnsClientNrptRule -Name $_.Name -Force } }"
{% endif %}
[Peer] # Settings for the Hub peer
PublicKey = {{ win_wg_spoke_hub_pubkey }}
{% if win_wg_spoke_psk is defined %}
PresharedKey = {{ win_wg_spoke_psk }}
{% endif %}
AllowedIPs = {{ win_wg_spoke_subnet }}/{{ win_wg_spoke_netmask }}
Endpoint = {{ win_wg_spoke_hub_ipv4_wan }}:{{ win_wg_spoke_hub_port }}
PersistentKeepalive = 20