Solved

SQL Server issue connecting to named instance

Posted on 2016-11-22
6
45 Views
Last Modified: 2016-11-23
This is an odd one that I've never seen before. I'm hoping someone can shed some light.

I have a SQL Server database with a default instance and a named instance. For the sake of this conversation we'll call the named instance SQL2.

Using the local IP address I can connect to the named instance just fine. See screenshot below.
working - localHowever, using the public IP address the connection fails. See similar screenshot below. (Public IP address is made up)
not working - publicFurther complicating things is that if I use the explicit port number instead of the named instance it works again.
working - publicI've never seen a case of a named instance failing to connect like this. There must be some kind of configuration issue I'm overlooking. Can anyone suggest a solution?
0
Comment
Question by:Russ Suter
6 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 41898409
did you tried adding a alias name for the instance? You'll need the SQL Server Configuration Manager. Go to Sql Native Client Configuration, Select Client Protocols, Right Click on TCP/IP and set your default port there.

https://msdn.microsoft.com/en-us/library/ms177440.aspx
<<Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)>>
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 41898689
Use Configuration Manager and check what protocols have you enabled for this SQL Server instance.
0
 
LVL 9

Accepted Solution

by:
miron earned 500 total points
ID: 41899395
Please read the following article: Configure the Windows Firewall to Allow SQL Server Access, URL: https://msdn.microsoft.com/en-us/library/cc646023.aspx

Relevant points:

1_
SQL Server default instance running over TCP TCP port 1433

2_
SQL Server Browser service UDP port 1434 The SQL Server Browser service listens for incoming connections to a named instance and provides the client the TCP port number that corresponds to that named instance. Normally the SQL Server Browser service is started whenever named instances of the Database Engine are used. The SQL Server Browser service does not have to be started if the client is configured to connect to the specific port of the named instance.  

3_
Entire subsection Configure a Windows Firewall for Database Engine Access, URL https://msdn.microsoft.com/en-us/library/ms175043.aspx

Document portion
A_
To open access to SQL Server when using dynamic ports
In the Program dialog box, select This program path. Click Browse, and navigate to the instance of SQL Server that you want to access through the firewall, and then click Open. By default, SQL Server is at C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Click Next. ( please note, application Sqlservr.exe location can differ in actual installation )

To summarize, ensure the following ports are opened for successfull connection to SQL Server:

UDP port 1434
TCP port 1433 ( Default instance )
TCP port for application sqlservr.exe ( Named instance dynamic port configuration )

-- cheers
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 20

Author Comment

by:Russ Suter
ID: 41899443
I'm looking into the SQL Server Browser service. The perimeter firewall may be blocking UDP traffic on port 1434. Unfortunately I don't have access to configure that firewall so I've submitted a request. I'll get back to you.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 41899447
What for do you need the SQL Browser service running? This is only needed if you use Name Pipes protocol. Is that what you want?
0
 
LVL 20

Author Closing Comment

by:Russ Suter
ID: 41899849
Opening Port 1434 to UDP traffic did the trick.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 46
sql query Help 12 34
Syntax using Declare 3 16
Safely Uninstall SQL Server 2008 R2 Express 3 26
Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now