update getwgpeerconfgs
This commit is contained in:
parent
047a0dc7be
commit
a6bacff44d
@ -232,11 +232,15 @@ func (conf DsnetConfig) GetWgPeerConfigs() []wgtypes.PeerConfig {
|
|||||||
presharedKey := peer.PresharedKey.Key
|
presharedKey := peer.PresharedKey.Key
|
||||||
|
|
||||||
// AllowedIPs = private IP + defined networks
|
// 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{
|
allowedIPs[0] = net.IPNet{
|
||||||
IP: peer.IP,
|
IP: peer.IP,
|
||||||
Mask: net.IPMask{255, 255, 255, 255},
|
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 {
|
for i, net := range peer.Networks {
|
||||||
allowedIPs[i+1] = net.IPNet
|
allowedIPs[i+1] = net.IPNet
|
||||||
|
Loading…
Reference in New Issue
Block a user