How to Create SQL Server 2016 Firewall Rules using GUI and PowerShell.
जीयूआई के साथ:
- Start the system and log in (with admin rights user);
2. खुला Control Panel. पर क्लिक करें Windows Firewall;
3. After that click on Advanced Settings;
4. Windows Firewall console open. If you click on गुण (right side) – you can disable firewalls for all networks. We going to Inbound Rules (left side) for our rule creation;
5. पर क्लिक करें New Rule;
6. Rule creation process begins. मेरे मामले में, I create a rule for Inbound TCP ports. के लिए Rule Type select option Port और क्लिक करें अगला;
7. के लिए Protocol and Ports select option TCP और Special Local Ports. मैं उपयोग करता हूं 2 ports for SCCM deployment (8080, 14331) and also added standard SQL TCP ports (1433,1434,4022). After entering ports click अगला;
8. के लिए कार्रवाई (in this case leave by default Allow the connection). क्लिक अगला;
9. के लिए Profile, leave by default, क्लिक अगला;
10. Enter a name for your rule (for example SQL TCP Ports), so you can easily find it in the future. क्लिक खत्म करना;
11. In the last screenshot, you see two rules, which I created for SQL Server. One for TCP ports and one for UPD port (1434).
पॉवरशेल के साथ:
- Run PowerShell as Administrator;
2. Enter text and press प्रवेश करना:
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.