mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
add ip6table rules for gateways
This commit is contained in:
@@ -169,3 +169,20 @@ func ShouldPublishPeerPorts(serverNode *models.Node) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func getNetworkProtocols(cidrs []string) (bool, bool) {
|
||||
ipv4 := false
|
||||
ipv6 := false
|
||||
for _, cidr := range cidrs {
|
||||
ip, _, err := net.ParseCIDR(cidr)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if ip.To4() == nil {
|
||||
ipv6 = true
|
||||
} else {
|
||||
ipv4 = true
|
||||
}
|
||||
}
|
||||
return ipv4, ipv6
|
||||
}
|
||||
|
Reference in New Issue
Block a user