mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-28 16:07:02 +08:00
set allowedip mask to /32 /128
This commit is contained in:
parent
319193c18a
commit
f42c04e3c6
1 changed files with 10 additions and 2 deletions
|
@ -922,10 +922,18 @@ func getEgressIPs(node, peer *models.Node) []net.IPNet {
|
|||
func getNodeAllowedIPs(peer, node *models.Node) []net.IPNet {
|
||||
var allowedips = []net.IPNet{}
|
||||
if peer.Address.IP != nil {
|
||||
allowedips = append(allowedips, peer.Address)
|
||||
allowed := net.IPNet{
|
||||
IP: peer.Address.IP,
|
||||
Mask: net.CIDRMask(32, 32),
|
||||
}
|
||||
allowedips = append(allowedips, allowed)
|
||||
}
|
||||
if peer.Address6.IP != nil {
|
||||
allowedips = append(allowedips, peer.Address6)
|
||||
allowed := net.IPNet{
|
||||
IP: peer.Address6.IP,
|
||||
Mask: net.CIDRMask(128, 128),
|
||||
}
|
||||
allowedips = append(allowedips, allowed)
|
||||
}
|
||||
// handle egress gateway peers
|
||||
if peer.IsEgressGateway {
|
||||
|
|
Loading…
Add table
Reference in a new issue