- Configure a Windows Firewall for Database Engine Access
- Before You Begin
- Security
- Using SQL Server Configuration Manager
- To open a port in the Windows firewall for TCP access
- To open access to SQL Server when using dynamic ports
- Настройка брандмауэра Windows для доступа к компоненту Database Engine Configure a Windows Firewall for Database Engine Access
- Перед началом Before You Begin
- безопасность Security
- Использование диспетчера конфигурации SQL Server Using SQL Server Configuration Manager
- Открытие порта в брандмауэре Windows для доступа TCP To open a port in the Windows firewall for TCP access
- Открытие доступа к SQL Server при использовании динамических портов To open access to SQL Server when using dynamic ports
Configure a Windows Firewall for Database Engine Access
Applies to: SQL Server (all supported versions)
This topic describes how to configure a Windows firewall for Database Engine access in SQL Server by using SQL Server Configuration Manager. Firewall systems help prevent unauthorized access to computer resources. To access an instance of the SQL Server Database Engine through a firewall, you must configure the firewall on the computer running SQL Server to allow access.
For more information about the default Windows firewall settings, and a description of the TCP ports that affect the Database Engine, 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:
Configure the Database Engine to use a specific TCP/IP port. The default instance of the Database Engine uses port 1433, but that can be changed. The port used by the Database Engine is listed in the SQL Server error log. Instances of SQL Server Express, SQL Server Compact, and named instances of the Database Engine 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).
Configure the firewall to allow access to that port for authorized users or computers.
The SQL Server Browser service lets users connect to instances of the Database Engine that are not listening on port 1433, without knowing the port number. To use SQL Server Browser, you must open UDP port 1434. To promote the most secure environment, leave the SQL Server Browser service stopped, and configure clients to connect using the port number.
By default, Microsoft Windows enables the Windows Firewall, which closes port 1433 to prevent Internet computers from connecting to a default instance of SQL Server 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 SQL Server to listen on a fixed port and opening the port, you can list the SQL Server 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 SQL Server can be accessed in this way.
In This Topic
Before you begin:
To configure a Windows Firewall for Database Engine access, using:
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 SQL Server Configuration Manager
Applies to Windows Vista, Windows 7, and Windows Server 2008
The following procedures configure the Windows Firewall by using the Windows Firewall with Advanced Security Microsoft Management Console (MMC) snap-in. The Windows Firewall with Advanced Security only configures the current profile. For more information about the Windows 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
On the Start menu, click Run, type WF.msc, and then click OK.
In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.
In the Rule Type dialog box, select Port, and then click Next.
In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, such as 1433 for the default instance. Click Next.
In the Action dialog box, select Allow the connection, and then click Next.
In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.
In the Name dialog box, type a name and description for this rule, and then click Finish.
To open access to SQL Server when using dynamic ports
On the Start menu, click Run, type WF.msc, and then click OK.
In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.
In the Rule Type dialog box, select Program, and then click Next.
In the Program dialog box, select This program path. Click Browse, and navigate to the instance of SQL Server that you want to access through the firewall, and then click Open. By default, SQL Server is at C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Click Next.
In the Action dialog box, select Allow the connection, and then click Next.
In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.
In the Name dialog box, type a name and description for this rule, and then click Finish.
Настройка брандмауэра Windows для доступа к компоненту Database Engine Configure a Windows Firewall for Database Engine Access
Применимо к: Applies to: SQL Server SQL Server (все поддерживаемые версии) SQL Server SQL Server (all supported versions) Применимо к: Applies to: SQL Server SQL Server (все поддерживаемые версии) SQL Server SQL Server (all supported versions)
В данном разделе описывается, как настроить брандмауэр Windows для доступа к компоненту Database Engine в SQL Server SQL Server с помощью диспетчера конфигурации SQL Server. This topic describes how to configure a Windows firewall for Database Engine access in SQL Server SQL Server by using SQL Server Configuration Manager. Системы брандмауэров предотвращают несанкционированный доступ к ресурсам компьютера. Firewall systems help prevent unauthorized access to computer resources. Чтобы обращаться к экземпляру компонента Компонент SQL Server Database Engine SQL Server Database Engine через брандмауэр, необходимо разрешить такой доступ в настройках брандмауэра на компьютере с SQL Server SQL Server . To access an instance of the Компонент SQL Server Database Engine SQL Server Database Engine through a firewall, you must configure the firewall on the computer running SQL Server SQL Server to allow access.
Дополнительные сведения о настройках брандмауэра Windows по умолчанию и описание портов TCP, влияющих на компонент Компонент Database Engine Database Engine , службы Analysis Services, службы Reporting Services и службы Integration Services, см. в разделе Настройка брандмауэра Windows для разрешения доступа к SQL Server. For more information about the default Windows firewall settings, and a description of the TCP ports that affect the Компонент Database Engine Database Engine , 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:
Настройка компонента Компонент Database Engine Database Engine для использования конкретного порта TCP/IP. Configure the Компонент Database Engine Database Engine to use a specific TCP/IP port. Экземпляр компонента Компонент Database Engine Database Engine по умолчанию использует порт 1433. Порт можно изменить. The default instance of the Компонент Database Engine Database Engine uses port 1433, but that can be changed. Порт, используемый компонентом Компонент Database Engine Database Engine , указывается в журнале ошибок SQL Server SQL Server . The port used by the Компонент Database Engine Database Engine is listed in the SQL Server SQL Server error log. Экземпляры SQL Server Express SQL Server Express , SQL Server Compact SQL Server Compact и именованные экземпляры компонента Компонент Database Engine Database Engine используют динамические порты. Instances of SQL Server Express SQL Server Express , SQL Server Compact SQL Server Compact , and named instances of the Компонент Database Engine Database Engine use dynamic ports. Сведения по настройке этих экземпляров для использования конкретного порта см. в разделе Настройка сервера для прослушивания указанного TCP-порта (диспетчер конфигурации SQL Server). To configure these instances to use a specific port, see Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager).
Настройка брандмауэра, чтобы разрешить доступ к порту для авторизованных пользователей или компьютеров. Configure the firewall to allow access to that port for authorized users or computers.
Служба браузера SQL Server SQL Server позволяет пользователям подключаться к экземплярам компонента Компонент Database Engine Database Engine , которые не прослушивают порт 1433, не зная номера порта. The SQL Server SQL Server Browser service lets users connect to instances of the Компонент Database Engine Database Engine that are not listening on port 1433, without knowing the port number. Для использования браузера SQL Server SQL Server необходимо открыть UDP-порт 1434. To use SQL Server SQL Server Browser, you must open UDP port 1434. Чтобы поддерживать наиболее безопасную среду, остановите службу браузера SQL Server SQL Server и настройте клиенты для подключения с помощью номера порта. To promote the most secure environment, leave the SQL Server SQL Server Browser service stopped, and configure clients to connect using the port number.
По умолчанию в Microsoft Microsoft Windows включен брандмауэр Windows, который закрывает порт 1433, чтобы защитить экземпляр по умолчанию SQL Server SQL Server компьютера от входящих соединений из Интернета. By default, Microsoft Microsoft Windows enables the Windows Firewall, which closes port 1433 to prevent Internet computers from connecting to a default instance of SQL Server SQL Server on your computer. Соединения с экземпляром по умолчанию по протоколу TCP/IP невозможны, пока порт 1433 не будет открыт. Connections to the default instance using TCP/IP are not possible unless you reopen port 1433. Основные шаги настройки брандмауэра Windows приведены в следующих процедурах. The basic steps to configure the Windows firewall are provided in the following procedures. Дополнительные сведения см. в документации по Windows. For more information, see the Windows documentation.
Как вариант, вместо настройки SQL Server SQL Server на прослушивание определенного порта и открытия порта можно включить исполняемый объект SQL Server SQL Server (Sqlservr.exe) в список исключений заблокированных программ. As an alternative to configuring SQL Server SQL Server to listen on a fixed port and opening the port, you can list the SQL Server SQL Server executable (Sqlservr.exe) as an exception to the blocked programs. Используйте этот метод, чтобы продолжить использовать динамические порты. Use this method when you want to continue to use dynamic ports. Таким методом можно получить доступ только к одному экземпляру SQL Server SQL Server . Only one instance of SQL Server SQL Server can be accessed in this way.
В этом разделе In This Topic
Перед началом работы Before you begin:
Как настроить брандмауэр Windows для доступа к ядру СУБД, используя следующее средство: To configure a Windows Firewall for Database Engine access, using:
Перед началом 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. Дополнительные сведения см. в разделе Security Considerations for a SQL Server Installation. For more information, see Security Considerations for a SQL Server Installation
Использование диспетчера конфигурации SQL Server Using SQL Server Configuration Manager
Относится к Windows Vista, Windows 7 и Windows Server 2008 Applies to Windows Vista, Windows 7, and Windows Server 2008
В следующих процедурах выполняется настройка брандмауэра Windows с помощью оснастки «Брандмауэр Windows в режиме повышенной безопасности» консоли управления (MMC). The following procedures configure the Windows Firewall by using the Windows Firewall with Advanced Security Microsoft Management Console (MMC) snap-in. В оснастке «Брандмауэр Windows в режиме повышенной безопасности» выполняется настройка только текущего профиля. The Windows Firewall with Advanced Security only configures the current profile. Дополнительные сведения о брандмауэре Windows в режиме повышенной безопасности см. в разделе Настройка брандмауэра Windows для разрешения доступа к SQL Server. For more information about the Windows Firewall with Advanced Security, see Configure the Windows Firewall to Allow SQL Server Access
Открытие порта в брандмауэре Windows для доступа TCP To open a port in the Windows firewall for TCP access
В меню Пуск выберите команду Выполнить, введите WF.msc и нажмите кнопку ОК. On the Start menu, click Run, type WF.msc, and then click OK.
На левой панели Брандмауэр Windows в режиме повышенной безопасности щелкните правой кнопкой мыши раздел Правила для входящих подключений и выберите на панели действий пункт Создать правило . In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.
В диалоговом окне Тип правила выберите Порт и нажмите кнопку Далее. In the Rule Type dialog box, select Port, and then click Next.
В диалоговом окне Протокол и порты выберите протокол TCP. In the Protocol and Ports dialog box, select TCP. Выберите пункт Определенные локальные порты и введите номер порта для экземпляра компонента Компонент Database Engine Database Engine , например 1433 для экземпляра по умолчанию. Select Specific local ports, and then type the port number of the instance of the Компонент Database Engine Database Engine , such as 1433 for the default instance. Щелкните Далее. Click Next.
В диалоговом окне Действие выберите Разрешить соединение и нажмите кнопку Далее. In the Action dialog box, select Allow the connection, and then click Next.
В диалоговом окне Профиль выберите профили, описывающие среду соединения компьютеров, который нужно подключить к компоненту Компонент Database Engine Database Engine , и нажмите кнопку Далее. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Компонент Database Engine Database Engine , and then click Next.
В диалоговом окне Имя введите имя и описание правила и нажмите кнопку Готово. In the Name dialog box, type a name and description for this rule, and then click Finish.
Открытие доступа к SQL Server при использовании динамических портов To open access to SQL Server when using dynamic ports
В меню Пуск выберите команду Выполнить, введите WF.msc и нажмите кнопку ОК. On the Start menu, click Run, type WF.msc, and then click OK.
На левой панели Брандмауэр Windows в режиме повышенной безопасности щелкните правой кнопкой мыши раздел Правила для входящих подключений и выберите на панели действий пункт Создать правило . In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.
В диалоговом окне Тип правила выберите Программа и нажмите кнопку Далее. In the Rule Type dialog box, select Program, and then click Next.
В диалоговом окне Программа выберите пункт Путь программы. In the Program dialog box, select This program path. Нажмите кнопку Обзор, найдите и выберите экземпляр SQL Server SQL Server , к которому необходим доступ через брандмауэр, а затем нажмите кнопку Открыть. Click Browse, and navigate to the instance of SQL Server SQL Server that you want to access through the firewall, and then click Open. По умолчанию исполняемым файлом SQL Server SQL Server является C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. By default, SQL Server SQL Server is at C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Щелкните Далее. Click Next.
В диалоговом окне Действие выберите Разрешить соединение и нажмите кнопку Далее. In the Action dialog box, select Allow the connection, and then click Next.
В диалоговом окне Профиль выберите профили, описывающие среду соединения компьютеров, который нужно подключить к компоненту Компонент Database Engine Database Engine , и нажмите кнопку Далее. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Компонент Database Engine Database Engine , and then click Next.
В диалоговом окне Имя введите имя и описание правила и нажмите кнопку Готово. In the Name dialog box, type a name and description for this rule, and then click Finish.