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