Skip to content

Commit

Permalink
...also for vyatta
Browse files Browse the repository at this point in the history
  • Loading branch information
naggie committed Oct 26, 2020
1 parent 5a870da commit 34ff77b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"
)

const wgQuickPeerConf = `[Interface]
const wgQuickPeerConf = `[Interface
Address={{ .Peer.IP }}/22
Address={{ .Peer.IP6 }}/64
PrivateKey={{ .Peer.PrivateKey.Key }}
Expand Down Expand Up @@ -46,7 +46,11 @@ set interfaces wireguard wg0 description {{ conf.InterfaceName }}
#set service dns forwarding name-server {{ .DsnetConfig.DNS }}
{{ end }}
{{ if gt (.DsnetConfig.ExternalIP | len) 0 -}}
set interfaces wireguard wg0 peer {{ .DsnetConfig.PrivateKey.PublicKey.Key }} endpoint {{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }}
{{ else -}}
set interfaces wireguard wg0 peer {{ .DsnetConfig.PrivateKey.PublicKey.Key }} endpoint {{ .DsnetConfig.ExternalIP6 }}:{{ .DsnetConfig.ListenPort }}
{{ end -}}
set interfaces wireguard wg0 peer {{ .DsnetConfig.PrivateKey.PublicKey.Key }} persistent-keepalive {{ .Keepalive }}
set interfaces wireguard wg0 peer {{ .DsnetConfig.PrivateKey.PublicKey.Key }} preshared-key {{ .Peer.PresharedKey.Key }}
{{ with .DsnetConfig.Network -}}
Expand Down

0 comments on commit 34ff77b

Please sign in to comment.