mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
iptables now being set by client
This commit is contained in:
@@ -592,12 +592,12 @@ func createGateway(w http.ResponseWriter, r *http.Request) {
|
||||
nodechange.IsGateway = true
|
||||
nodechange.GatewayRange = gateway.RangeString
|
||||
if gateway.PostUp == "" {
|
||||
nodechange.PostUp = "iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o " + gateway.Interface + " -j MASQUERADE"
|
||||
nodechange.PostUp = "iptables -A FORWARD -i " + node.Interface + " -j ACCEPT; iptables -t nat -A POSTROUTING -o " + gateway.Interface + " -j MASQUERADE"
|
||||
} else {
|
||||
nodechange.PostUp = gateway.PostUp
|
||||
}
|
||||
if gateway.PostDown == "" {
|
||||
nodechange.PostDown = "iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o " + gateway.Interface + " -j MASQUERADE"
|
||||
nodechange.PostDown = "iptables -D FORWARD -i " + node.Interface + " -j ACCEPT; iptables -t nat -D POSTROUTING -o " + gateway.Interface + " -j MASQUERADE"
|
||||
} else {
|
||||
nodechange.PostDown = gateway.PostDown
|
||||
}
|
||||
|
Reference in New Issue
Block a user