To connect to our SQL Server remotely, follow the steps below. First of all, make sure of your safety while doing this process. The first thing you need to do is to allow remote connections to the SQL Server. We open SQL Server Management Studio and connect to the server. Then right-click on the server and open the Server properties.
We go to Connections and check that “Allow remote connections to this server” is ticked in the market place. If it is not, we tick this box and continue.
It then goes into SQL Server Network Configuration. We open “SQL Server Configuration Manager” and make the necessary settings from the TCP/IP settings as follows. Make sure that TCP/IP is enabled and the TCP Port is 1433.
As a first step, you can check which port is used by TCP/IP by right-clicking TCP/IP and select Properties. Click the IP Addresses tab and check the TCP Port. By default, the SQL Port will be 1433.
Creating Rules for SQL Port in Firewall
The next thing to do is to allow TCP/IP traffic from the firewall over Port 1433. To create a rule for SQL Port in the firewall, select the “Inbound Rules” section on the left in the advanced settings section of the firewall settings in the control panel and click the new rule option on the right.
On the screen that opens, we choose the Port option in the new rule wizard and continue.
We select the “Allow the Connection” option and continue with the “Next” button.
We choose the “Domain” option and continue with the “Next” button.
We enter a name in our SQL port rule. We complete the process by clicking the “Finish” button.
We give the necessary rules to the SSL VPN Client and Firewall Rule sections in order to establish a secure connection by the Firewall. We have written VPN_LAN and LAN_VPN rules in the “Sophos Rules and Policies” section of Sophos Firewall so that the user we have added to the SSL VPN Client group can safely log out of the firewall.
Later, we downloaded the SSMS application, made our SSL VPN connection and provided security network access, and then entered our login information as below and performed our SQL connection securely.