views:

3118

answers:

9

Hi,

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 ?

Thanks, Chakravarthy

+2  A: 

Check that the port that SQL Server is using is not being blocked by either your firewall or the VPN.

Tom H.
+1  A: 

You may not have the UDP port open/VPN-forwarded, it's port number 1433.

Despite client protocol name of "TCP/IP", mssql uses UDP for bitbanging.

Pasi Savolainen
SQL Server uses udp/1434 for returning information on how to connect to a named instance. SQL Server uses tcp, not udp, for all actual communication between client and server.
K. Brian Kelley
+1  A: 

SQL Server uses the TCP port 1433. This is probably blocked either by the VPN tunnel or by a firewall on the server.

Guffa
+2  A: 

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.

WakeUpScreaming
A: 

When connecting to VPN every message goes through VPN server and it could not be forwarding your messages to that port SQL server is working on.

Try

disable VPN settings->Properties->TCP/IP properties->Advanced->Use default gateway on remote network.

This way you will first try to connect local IP of SQL server and only then use VPN server to forward you

Sergej Andrejev
+2  A: 

Make sure SQL Server is enabled for TCP/IP (someone may have disabled it)?

This will also help you to check/verify the port number the SQL instance is using (in case someone changed it from the default of port 1433).

Obviously port 1433 (or whatever port SQL is listening on) needs to be unblocked by any firewalls between your machine and the box SQL is running on.

To check SQL's network configuration (requires SQL Server Client Tools installed): Start -> Programs -> SQL Server 200x -> Configuration Tools -> SQL Server Configuration Manager

Connect to the machine you need then expand the Tree Item (LHS) "SQL Server Network Configuration", then pick instance. You should have four options - Shared Memory, Named Pipes, TCP/IP and VIA. You can check that TCP/IP is enabled in the RHS window.

If you double click TCP/IP and hit the "Advanced" tab, you can also view the Port number.

Other thoughts.. Are you using SQL Authentication or Windows (Domain) authentication?

  • If SQL Authentication (which I assume you are using given you said username and password), are you sure the SQL instance you're connecting to has mixed mode authentication enabled? If not, you have to connect as Administrator and change the default security settings to allow SQL authentication.

  • If Windows Authentication, could your network be using Kerberos potentially? One would think the VPN credentials would be used for the handshake. I'd check your account has appropriate login rights.

RobS
+2  A: 

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.

K. Brian Kelley
A: 

Check out this blog post which covers the basic troubleshooting steps when you can't connect to SQL Server.

mrdenny
A: 

if you're using sql server 2005, start sql server browser service first

Happy