# Set Up Network and Firewalls

Depending on the SQL version used, program paths and registry keys change as follows:

* MSSQL Server 2019 (=MSSQL15)
* MSSQL Server 2022 (=MSSQL16)

### Firewall configuration

As with all IONOS Cloud Windows images, the firewall is turned on automatically. For security reasons, no rules for SQL access over the network have been configured yet. We recommend setting up an incoming firewall rule of type **Program** if you want to access the SQL instance over the network. To do so, use one of the following options:

**Option 1:** Create an exception for the data transmission of the following program:

```bash
%ProgramFiles%\Microsoft SQL Server\<MSSQLXX>.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
```

Example for MSSQL Server 2022

```bash
%ProgramFiles%\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
```

**Option 2:** Create the program rule from the command line:

{% hint style="info" %}
**Note:** The IP address used here is only an example; change it according to your configuration.
{% endhint %}

```bash
netsh advfirewall firewall add rule name="SQL-Server" dir=in
action=allow program="%ProgramFiles%\Microsoft SQL Server\<MSSQLXX>.MSSQLSERVER\MSSQL\Binn\sqlservr.exe" enable=yes
remoteip=10.101.101.10/24
```

### TCP/IP binding

For network communication, Microsoft SQL Server images have preconfigured TCP/IP bindings. In some cases, they need to be reconfigured before a newly assigned IP (v4/v6) works properly for SQL.

```bash
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<MSSQLXX>.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\Tcp
```

Example for MSSQL Server 2022:

```bash
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\Tcp
```

![Registry Editor](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-7eedf07f6e0c01167c79409095c86f5a6e563aef%2Fregistry-editor.png?alt=media)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/backup-and-storage/images-snapshots/public-images/microsoft-sql-server-images/how-tos/set-up-network-firewalls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
