Tip: Connecting to a SQL Server named instance on a cluster behind a firewall

Tip: Connecting to a SQL Server named instance on a cluster behind a firewall


When trying to connect to a SQL Server named instance (on a cluster) behind a network firewall, you may receive the following error message: SQL Server does not exist or access denied.


By default, a SQL Server connection is made to the remote 1433 port. However, some installations have more than one SQL server instance running in the same physical server, which forces the instances to choose a different port. This port selection can be done dynamically or fixed by the DBA to a specific port number. Either way, the client will always try to connect to the 1433 port by default, but after that, it will search for it's named instance using the discovery process, which means that it will use the Discovery service of the SQL Server to find the proper named instance. This service runs on the SQL server, usually on the UDP 1434 port, and uses several broadcast messages to find the named instance and negociate a port between Client and Server (named instance). Behind a network firewall, this protocol may be compromissed and blocked and no connection is made to the named instance.


The solution for this type of scenario is to use a fixed port in the named instance in question, and also specify that port on the client data source connection string to bypass the discovery process. In order to do so, one must just use the syntax "sqlserveripaddress,portnumber" in the connection string. Particularly, in the Hub Server Configuration Tool, in the "server" textbox insert "ipaddress,portnumber" and in the machine.config file also add the same string in the data source of the "sqlConnectionString" property in the "sessionState" entry.

For more information please refer to the Microsoft article http://support.microsoft.com/?kbid=888228

Best regards

Miguel João