Skip to content

Latest commit

 

History

History
84 lines (53 loc) · 7.65 KB

File metadata and controls

84 lines (53 loc) · 7.65 KB
title Configure a Windows Firewall for Database Engine Access
description Find out how to configure a Windows firewall so that client computers can access an instance of the SQL Server Database Engine through the firewall.
ms.custom
ms.date 12/16/2021
ms.prod sql
ms.prod_service high-availability
ms.reviewer
ms.technology configuration
ms.topic conceptual
helpviewer_keywords
connections [SQL Server], firewall systems
firewall systems, [Database Engine]
security [SQL Server], firewalls
ms.assetid 0093b43c-c6b5-4574-9b30-3a0e91e1a1f9
author rwestMSFT
ms.author randolphwest

Configure a Windows Firewall for Database Engine Access

[!INCLUDE SQL Server]

This topic describes how to configure a Windows firewall for Database Engine access in [!INCLUDEssnoversion] by using SQL Server Configuration Manager. Firewall systems help prevent unauthorized access to computer resources. To access an instance of the [!INCLUDEssDEnoversion] through a firewall, you must configure the firewall on the computer running [!INCLUDEssNoVersion] to allow access.

For more information about the default Windows firewall settings, and a description of the TCP ports that affect the [!INCLUDEssDE], Analysis Services, Reporting Services, and Integration Services, see Configure the Windows Firewall to Allow SQL Server Access. There are many firewall systems available. For information specific to your system, see the firewall documentation.

The principal steps to allow access are:

  1. Configure the [!INCLUDEssDE] to use a specific TCP/IP port. The default instance of the [!INCLUDEssDE] uses port 1433, but that can be changed. The port used by the [!INCLUDEssDE] is listed in the [!INCLUDEssNoVersion] error log. Instances of [!INCLUDEssExpress], [!INCLUDEssEW], and named instances of the [!INCLUDEssDE] use dynamic ports. To configure these instances to use a specific port, see Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager).

  2. Configure the firewall to allow access to that port for authorized users or computers.

Note

The [!INCLUDEssNoVersion] Browser service lets users connect to instances of the [!INCLUDEssDE] that are not listening on port 1433, without knowing the port number. To use [!INCLUDEssNoVersion] Browser, you must open UDP port 1434. To promote the most secure environment, leave the [!INCLUDEssNoVersion] Browser service stopped, and configure clients to connect using the port number.

Note

By default, [!INCLUDEmsCoName] Windows enables the Windows Firewall, which closes port 1433 to prevent Internet computers from connecting to a default instance of [!INCLUDEssNoVersion] on your computer. Connections to the default instance using TCP/IP are not possible unless you reopen port 1433. The basic steps to configure the Windows firewall are provided in the following procedures. For more information, see the Windows documentation.

As an alternative to configuring [!INCLUDEssNoVersion] to listen on a fixed port and opening the port, you can list the [!INCLUDEssNoVersion] executable (Sqlservr.exe) as an exception to the blocked programs. Use this method when you want to continue to use dynamic ports. Only one instance of [!INCLUDEssNoVersion] can be accessed in this way.

Before you begin

Security

Opening ports in your firewall can leave your server exposed to malicious attacks. Make sure that you understand firewall systems before you open ports. For more information, see Security Considerations for a SQL Server Installation

Using Windows Defender Firewall with Advanced Security

The following procedures configure the Windows Firewall by using the Windows Defender Firewall with Advanced Security Microsoft Management Console (MMC) snap-in. The Windows Defender Firewall with Advanced Security only configures the current profile. For more information about the Windows Defender Firewall with Advanced Security, see Configure the Windows Firewall to Allow SQL Server Access

To open a port in the Windows firewall for TCP access

  1. On the Start menu, select Run, type WF.msc, and then select OK.

  2. In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

  3. In the Rule Type dialog box, select Port, and then select Next.

  4. In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the [!INCLUDEssDE], such as 1433 for the default instance. Select Next.

  5. In the Action dialog box, select Allow the connection, and then select Next.

  6. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the [!INCLUDEssDE], and then select Next.

  7. In the Name dialog box, type a name and description for this rule, and then select Finish.

To open access to SQL Server when using dynamic ports

  1. On the Start menu, select Run, type WF.msc, and then select OK.

  2. In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

  3. In the Rule Type dialog box, select Program, and then select Next.

  4. In the Program dialog box, select This program path. Select Browse, and navigate to the instance of [!INCLUDEssNoVersion] that you want to access through the firewall, and then select Open. By default, [!INCLUDEssNoVersion] is at C:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Select Next. The MSSQLXX version will be specific to your version of SQL Server.

  5. In the Action dialog box, select Allow the connection, and then select Next.

  6. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the [!INCLUDEssDE], and then select Next.

  7. In the Name dialog box, type a name and description for this rule, and then select Finish.

See Also

How to: Configure Firewall Settings (Azure SQL Database)