Add windows firewall rule for listen_addr_securable
vsphere stmecells need to have explicit rule added for accessing rep on
listen_addr_securable.
@@ -14,3 +14,15 @@ if (-Not (Get-NetFirewallRule | Where-Object { $_.DisplayName -eq "RepPort" }))
Write-Error "Unable to add RepPort firewall rule"
}
}
+
+$PORT="<%= p("diego.rep.listen_addr_securable").match(/:(\d+)/)[1]%>"
+
+if ($PORT -eq "") {
+ Write-Error "Unable to find the listen_addr_securable port for rep_windows"
+}
+if (-Not (Get-NetFirewallRule | Where-Object { $_.DisplayName -eq "SecureRepPort" })) {
+ New-NetFirewallRule -DisplayName "SecureRepPort" -Action Allow -Direction Inbound -Enabled True -LocalPort $PORT -Protocol TCP
+ if (-Not (Get-NetFirewallRule | Where-Object { $_.DisplayName -eq "SecureRepPort" })) {
+ Write-Error "Unable to add RepPort firewall rule"
+ }
+}
