This repository has been archived on 2025-02-14. You can view files and clone it, but cannot push or open issues or pull requests.
esh/esh_wireguard/templates/default/server.wg0.conf.erb
2025-02-15 01:05:58 +09:00

14 lines
No EOL
596 B
Text

[Interface]
PrivateKey = <%= @privkey %>
Address = <%= @address %>
ListenPort = <%= @listenport %>
SaveConfig = true
<% if node['esh']['wireguard']['server']['routing'] %>
PostUp = ufw route allow in on wg0 out on <%= @pubint %>
PostUp = iptables -t nat -I POSTROUTING -o <%= @pubint %> -j MASQUERADE
PostUp = ip6tables -t nat -I POSTROUTING -o <%= @pubint %> -j MASQUERADE
PreDown = ufw route delete allow in on wg0 out on <%= @pubint %>
PreDown = iptables -t nat -D POSTROUTING -o <%= @pubint %> -j MASQUERADE
PreDown = ip6tables -t nat -D POSTROUTING -o <%= @pubint %> -j MASQUERADE
<% end %>