From a6bacff44d1b1f235115ad3142e8fc20c21d7c4f Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Tue, 27 Oct 2020 21:42:21 +0000 Subject: [PATCH] update getwgpeerconfgs --- configtypes.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configtypes.go b/configtypes.go index 5688c08..794a971 100644 --- a/configtypes.go +++ b/configtypes.go @@ -232,11 +232,15 @@ func (conf DsnetConfig) GetWgPeerConfigs() []wgtypes.PeerConfig { presharedKey := peer.PresharedKey.Key // AllowedIPs = private IP + defined networks - allowedIPs := make([]net.IPNet, len(peer.Networks)+1) + allowedIPs := make([]net.IPNet, len(peer.Networks)+2) allowedIPs[0] = net.IPNet{ IP: peer.IP, Mask: net.IPMask{255, 255, 255, 255}, } + allowedIPs[1] = net.IPNet{ + IP: peer.IP6, + Mask: net.IPMask{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + } for i, net := range peer.Networks { allowedIPs[i+1] = net.IPNet