mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-10 13:57:48 +08:00
fix node addr mask
This commit is contained in:
parent
ea46ea5378
commit
cd669774c0
1 changed files with 16 additions and 4 deletions
|
@ -498,7 +498,10 @@ func GetFwRulesOnIngressGateway(node models.Node) (rules []models.FwRule) {
|
||||||
if !defaultUserPolicy.Enabled {
|
if !defaultUserPolicy.Enabled {
|
||||||
rules = append(rules, models.FwRule{
|
rules = append(rules, models.FwRule{
|
||||||
SrcIP: userNodeI.StaticNode.AddressIPNet4(),
|
SrcIP: userNodeI.StaticNode.AddressIPNet4(),
|
||||||
DstIP: peer.Address,
|
DstIP: net.IPNet{
|
||||||
|
IP: peer.Address.IP,
|
||||||
|
Mask: net.CIDRMask(32, 32),
|
||||||
|
},
|
||||||
Allow: true,
|
Allow: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -507,7 +510,10 @@ func GetFwRulesOnIngressGateway(node models.Node) (rules []models.FwRule) {
|
||||||
if userNodeI.StaticNode.Address6 != "" {
|
if userNodeI.StaticNode.Address6 != "" {
|
||||||
rules = append(rules, models.FwRule{
|
rules = append(rules, models.FwRule{
|
||||||
SrcIP: userNodeI.StaticNode.AddressIPNet6(),
|
SrcIP: userNodeI.StaticNode.AddressIPNet6(),
|
||||||
DstIP: peer.Address6,
|
DstIP: net.IPNet{
|
||||||
|
IP: peer.Address6.IP,
|
||||||
|
Mask: net.CIDRMask(128, 128),
|
||||||
|
},
|
||||||
Allow: true,
|
Allow: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -571,14 +577,20 @@ func GetFwRulesOnIngressGateway(node models.Node) (rules []models.FwRule) {
|
||||||
if nodeI.StaticNode.Address != "" {
|
if nodeI.StaticNode.Address != "" {
|
||||||
rules = append(rules, models.FwRule{
|
rules = append(rules, models.FwRule{
|
||||||
SrcIP: nodeI.StaticNode.AddressIPNet4(),
|
SrcIP: nodeI.StaticNode.AddressIPNet4(),
|
||||||
DstIP: peer.Address,
|
DstIP: net.IPNet{
|
||||||
|
IP: peer.Address.IP,
|
||||||
|
Mask: net.CIDRMask(32, 32),
|
||||||
|
},
|
||||||
Allow: true,
|
Allow: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if nodeI.StaticNode.Address6 != "" {
|
if nodeI.StaticNode.Address6 != "" {
|
||||||
rules = append(rules, models.FwRule{
|
rules = append(rules, models.FwRule{
|
||||||
SrcIP: nodeI.StaticNode.AddressIPNet6(),
|
SrcIP: nodeI.StaticNode.AddressIPNet6(),
|
||||||
DstIP: peer.Address6,
|
DstIP: net.IPNet{
|
||||||
|
IP: peer.Address6.IP,
|
||||||
|
Mask: net.CIDRMask(128, 128),
|
||||||
|
},
|
||||||
Allow: true,
|
Allow: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue