Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not connecting to SQL Server over VPN

I have connected for the first time to an existing network over VPN. I can ping the IP address which is used by the SQL Server from the VPN client, but SSMS does not connect to the SQL Server. I am using the right login id and password.

Why could this happen? Any ideas?

like image 457
Chakra Avatar asked Mar 21 '09 14:03

Chakra


People also ask

Why SQL Server is not connecting?

The following common scenarios can cause connectivity problems: Incorrect IP address for the Server field. Make sure that the IP address matches the entry in the SQL Server error log file. Incorrect server name in the Server field.

Is SQL Server TCP or UDP?

By default, the typical ports used by SQL Server and associated database engine services are: TCP 1433, 4022, 135, 1434, UDP 1434.


2 Answers

On a default instance, SQL Server listens on TCP/1433 by default. This can be changed. On a named instance, unless configured differently, SQL Server listens on a dynamic TCP port. What that means is should SQL Server discover that the port is in use, it will pick another TCP port. How clients usually find the right port in the case of a named instance is by talking to the SQL Server Listener Service/SQL Browser. That listens on UDP/1434 and cannot be changed. If you have a named instance, you can configure a static port and if you have a need to use Kerberos authentication/delegation, you should.

What you'll need to determine is what port your SQL Server is listening on. Then you'll need to get with your networking/security folks to determine if they allow communication to that port via VPN. If they are, as indicated, check your firewall settings. Some systems have multiple firewalls (my laptop is an example). If so, you'll need to check all the firewalls on your system.

If all of those are correct, verify the server doesn't have an IPSEC policy that restricts access to the SQL Server port via IP address. That also could result in you being blocked.

like image 61
K. Brian Kelley Avatar answered Sep 23 '22 15:09

K. Brian Kelley


When this happens to me, it is because DNS is not working properly. Try using the IP address instead of the server name in the SQL Server login.

like image 22
WakeUpScreaming Avatar answered Sep 23 '22 15:09

WakeUpScreaming