How to Create SQL Servidor 2016 Firewall Rules using GUI y PowerShell.
Con interfaz gráfica de usuario:
- Start the system and registro en (with admin rights user);
2. Abierto Panel de control. Hacer clic en Cortafuegos de Windows;
3. After that click on Advanced Settings;
4. Cortafuegos de Windows console open. If you click on Propiedades (right side) – you can disable firewalls for all networks. We going to Inbound Rules (left side) for our rule creation;
5. Hacer clic en New Rule;
6. Rule creation process begins. en mi caso, I create a rule for Inbound TCP ports. Para Rule Type select option Port y haga clic Próximo;
7. Para Protocol and Ports select option TCP y Special Local Ports. yo uso 2 ports for SCCM despliegue (8080, 14331) and also added standard SQL TCP ports (1433,1434,4022). After entering ports click Próximo;
8. Para Action (in this case leave by default Allow the connection). Hacer clic Próximo;
9. Para Profile, leave by default, hacer clic Próximo;
10. Enter a name for your rule (Por ejemplo SQL TCP Ports), so you can easily find it in the future. Hacer clic Finalizar;
11. In the last screenshot, you see two rules, which I created for SQL Servidor. One for TCP ports and one for UPD puerto (1434).
Con PowerShell:
- Correr PowerShell como administrador;
2. Enter text and press Ingresar:
New-NetFirewallRule -DisplayName "SQL TCP Ports" -Direction Inbound –Protocol TCP –LocalPort 8080, 1433, 1434, 4022, 14331 -Action allow
Some explanations:
-DisplayName “SQL TCP Ports” – Rule Name;
-Direction Inbound – Rule direction;
–Protocol TCP – Protocol (TCP or UDP);
–LocalPort – Your ports;
-Action allow – Allow or Disallow.