2

I have at home a D-Link DIR-615 C1 router with DD-WRT. I set up the SSH server on the router, and log on through an SSH2-RSA passphrase-protected key. That router is the gateway between the local network and the internet. One of the computers on that network has Microsoft SQL Server 2008 installed, with TCP/IP protocol enabled through port 1433. I've set up port forwarding on the router, so that remote connections are possible and are, in fact, working (some developers log on remotely without problems).

I am part of another network, that has internet access through a proxy server, which only has ports 80 and 443 opened. I can't connect to that MSSQL server on that remote server because 1433 port is closed on this network.
I connected (using Putty) through 443 port to my router's SSH server, and set up 2 tunnels. One is for RDP (3389), and it's working. The other is for 1433 port, to connect to the server.

I can't connect through the SSH tunnel to the MS SQL Server, neither through telnet, or through GUI clients.

Am I missing something?

Additional details:
on connect, I get this error from SQL Server Management Studio:

TITLE: Connect to Server

Cannot connect to localhost:14330.


ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 3)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=3&LinkId=20476


BUTTONS:

OK

The tunnel is configured like this:
L14330 192.168.0.103:1433
192.168.0.103 is the permanent address of the SQL Server on the LAN. I also successfully forwarded TCP traffic of 3389 port to that IP, so tunneling is working to that IP address.

When connecting without tunnel, through Microsoft SQL Server Management Studio, using the same method the connection establishes. Too bad my proxy doesn't allow 1433 port traffic, I wouldn't have this headache.

3 Answers 3

1

When upgrading to a newer Dlink Router, I had the problem of no longer being able to connect to SQL SVR between computers on my network (plugged into the Dlink Router).

I found the solution on this forum.

Disabling "Advanced DNS Service". Enabled is the default.

(Setup > Internet > Manual Internet Connection Setup > Advanced DNS Service)

According to the post that I found, it also resolves difficulties connecting RDP. The was some speculation that the SQL SVR connection requests were being sent out to OpenDNS thus preventing the desired connection.

For SQL SVR 2008, there is some additional Surface area configuration needed to allow connections including connections to named instances.

Note that with Open DNS turned on, you can enable local SQL SVR connections using the port forwarding settings of the Dlink Router. If you turn off Open DNS, the port forwarding settings are not required for connections between computers on your network. If you want to allow SQL SVR connections from the Internet to computers on your DLink Network, you need to configure this in Virtual Server settings (not Port Forwarding). Both Port forwarding and Virtual Server are found on the advanced tab.

My Router is less than a year old (DIR 655)

0

Random thought:

Some routers have a "VPN passthrough" (or similar) setting.

From your link, I found this on VPNs

3
  • Yes, it does have VPN through PPTP, but also failed to set it up. I was able to connect, but authentication failed for some reason. I was using PPTP through SSH tunnels too. Had to forward a few ports, but didn't help.
    – Alex
    Feb 10, 2011 at 13:10
  • Connection timeout...failure message? You can't ping your SQL Server to which you are trying to connect?
    – jl.
    Feb 10, 2011 at 14:43
  • I've updated the question.
    – Alex
    Feb 10, 2011 at 14:57
0

Is the MSSQL server accessible from the tunnel/ssh endpoint?

Make sure the destination IP and port is correct on the ssh tunnel.

Make sure you are connecting telnet or gui client to LOCALHOST:PORT.

2
  • I can get pings to that IP, but I have no idea how to connect to a specific port (using router Shell)
    – Alex
    Feb 10, 2011 at 14:59
  • From dd-wrt's SSH shell, just use telnet to test whatever you want to connect to. telnet localhost 14330 for example. Jan 7, 2012 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.