mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
v0.7
This commit is contained in:
@@ -559,8 +559,6 @@ func CreateEgressGateway(gateway models.EgressGatewayRequest) (models.Node, erro
|
||||
if err != nil {
|
||||
return models.Node{}, err
|
||||
}
|
||||
log.Println("GATEWAY:",gateway)
|
||||
log.Println("NODE:",node)
|
||||
err = ValidateEgressGateway(gateway)
|
||||
if err != nil {
|
||||
return models.Node{}, err
|
||||
@@ -699,16 +697,17 @@ func CreateIngressGateway(netid string, macaddress string) (models.Node, error)
|
||||
postDownCmd := "iptables -D FORWARD -i " + node.Interface + " -j ACCEPT; iptables -t nat -D POSTROUTING -o " + node.Interface + " -j MASQUERADE"
|
||||
if node.PostUp != "" {
|
||||
if !strings.Contains(node.PostUp, postUpCmd) {
|
||||
node.PostUp = node.PostUp + "; " + postUpCmd
|
||||
postUpCmd = node.PostUp + "; " + postUpCmd
|
||||
}
|
||||
}
|
||||
if node.PostDown != "" {
|
||||
if !strings.Contains(node.PostDown, postDownCmd) {
|
||||
node.PostDown = node.PostDown + "; " + postDownCmd
|
||||
postDownCmd = node.PostDown + "; " + postDownCmd
|
||||
}
|
||||
}
|
||||
node.SetLastModified()
|
||||
|
||||
node.PostUp = postUpCmd
|
||||
node.PostDown = postDownCmd
|
||||
key, err := functions.GetRecordKey(node.MacAddress, node.Network)
|
||||
if err != nil {
|
||||
return models.Node{}, err
|
||||
|
Reference in New Issue
Block a user