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

14 lines
596 B
Text
Raw Permalink Normal View History

2025-02-15 00:56:26 +09:00
[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 %>