Add autogen for peers
This commit is contained in:
parent
99b6b1577b
commit
1bd241e745
6 changed files with 1061 additions and 89 deletions
|
@ -37,15 +37,13 @@ import (
|
|||
|
||||
const confFmt = `[Interface]
|
||||
PrivateKey = {{.PrivateKey}}
|
||||
{{if gt .ListenPort 0}}ListenPort = {{.ListenPort}}{{end}}
|
||||
{{if .ListenPort}}ListenPort = {{.ListenPort}}{{end}}
|
||||
Address = {{.Address}}
|
||||
{{if .DNS }}DNS = {{.DNS}}{{end}}
|
||||
|
||||
{{if .Masquerade}}
|
||||
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o {{.Masquerade.Interface}} -j MASQUERADE
|
||||
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o {{.Masquerade.Interface}} -j MASQUERADE
|
||||
{{end}}
|
||||
|
||||
{{range $peer := .Peers -}}
|
||||
# {{$peer.ID}}
|
||||
[Peer]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue