Abhishek Kondur 2 rokov pred
rodič
commit
d74c98d001
2 zmenil súbory, kde vykonal 7 pridanie a 11 odobranie
  1. 3 3
      logic/gateway.go
  2. 4 8
      models/host.go

+ 3 - 3
logic/gateway.go

@@ -115,9 +115,9 @@ func CreateIngressGateway(netid string, nodeid string, ingress models.IngressReq
 	if host.FirewallInUse == models.FIREWALL_NONE {
 		return models.Node{}, errors.New("firewall is not supported for ingress gateways")
 	}
-	// if host.NatType != models.NAT_Types.Public {
-	// 	return models.Node{}, errors.New("ingress cannot be created on nodes behind NAT")
-	// }
+	if host.NatType != models.NAT_Types.Public {
+		return models.Node{}, errors.New("ingress cannot be created on nodes behind NAT")
+	}
 
 	network, err := GetParentNetwork(netid)
 	if err != nil {

+ 4 - 8
models/host.go

@@ -24,15 +24,11 @@ var OS_Types = struct {
 
 // NAT_Types - the type of NAT in which a HOST currently resides (simplified)
 var NAT_Types = struct {
-	Public     string
-	Symmetric  string
-	Asymmetric string
-	Double     string
+	Public    string
+	BehindNAT string
 }{
-	Public:     "public",
-	Symmetric:  "symmetric",
-	Asymmetric: "asymmetric",
-	Double:     "double",
+	Public:    "public",
+	BehindNAT: "behind_nat",
 }
 
 // WIREGUARD_INTERFACE name of wireguard interface