hello @LienAntim
The recommended way to do this is to set up a VPN between the two sites. The steps to do this vary depending on the particular firewall/router being used. If a VPN cannot be used, the following information is provided for how to set up a connection with port mapping. If port-mapping is used, it should only be used in conjunction with additional firewall rules to restrict what source IP addresses can route through the mapped port so that every hacker on earth doesn't have access to your SQL Server.
- Server IP Configuration
Check your Windows Server's IP configuration by running IPCONFIG / ALL. Your results can contain both IP addresses, but at least your internal IP:
. 192.168.1.24
. 95.218.133.168 - Check your routing
Start a traceroute with the following command: TRACERT <external IP of server>. Verify that you receive the route to your server. - Check your SQL Server IP Configuration
In the SQL Server Configuration Manager open up the branch for SQL Server-network configuration and select your instance. (E.g. Protocols for 'MSSQLSERVER')
Right-click
and open up the properties. Verify that you don't have any settings that could inhibit a connection. Close the setting when you have finished.
In the right-hand pane for the protocol settings verify that the TCP/IP protocol is 'Enabled'.
Now right-click the TCP/IP setting and open up the properties. In the Protocol tab...
a) Verify again that Enabled is set to Yes.
b) Verify that the setting Listen All is set to Yes.
c) The screen should look like this: - Check your router configuration
Your public IP is not the server's, it's the router's. If your server is behind the router then you have to ensure your router is forwarding the request to your SQL Server. This configuration setting can vary from router to router. Here a few examples for configuring routers:
- Port Forwarding (Zyxel)
- Setting up static port sharing (Fritz AVM)
- How do I configure Port Forwarding on my router? (D-Link)
============================================
If the answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.