1

telnet some_ip 1433

On Windows 7 this line doesn't work. It says it cannot establish connection. I'm 100% percent sure that the server has this port open. For a friend of mine this line works.

I suspect 2 reasons:

  • My ISP blocks this port.
  • My system blocks it.

I turned off the firewall and windows firewall. Is there anything else I can do to make sure the problem is not related to my system configuration?

BTW, I don't know if it's important, but

telnet some_ip 80

works fine

EDIT

Wireshark log here

I replaced the ip I tried to telnet with

<my_ip>
Andrzej Gis
  • 123
  • 1
  • 1
  • 5
  • If you have a second system at home (e.g. desktop and a laptop) then try it from the other system. If it works from the other then you know it is case 2. – Hennes Jan 12 '13 at 20:54

4 Answers4

3

Using telnet is a very good and useful tool to trace/troubleshoot connectivity.

Here is what I do:

a) On the SQL Server box itself: telnet localhost 1433 -- This is to make sure a remote connection is even possible

b) On another box, on the same local net where the SQL server box lives: telnet 1433 -- This tells you if it is even possible to hit the port "off the box"

c) Now, if everything is working... it depends on what tools and access you have. Ex 1: Can the telnet be done from the firewall where the SQL Server lives? Ex 2: Can telnet be done from another non-local-to-SQL system that has to go through that firewall?

Often you can only get through 'b', and then you have to look at three things step by step:

  • Firewall where SQL Server lives
  • Firewall hardware on your side (where you run telnet)
  • Local OS firewall on the machine you are at running telnet (e.g. outbound filter or such blocking your outbound connection)
Jonesome Reinstate Monica
  • 5,445
  • 10
  • 56
  • 82
1

On the PC, run a traffic sniffer like Wireshark or Network Monitor and see what the network responses are when you try to open a telnet connection. That will tell you if outbound traffic on that port is being blackholed or otherwise tampered with.

It is highly unlikely that an ISP would be blocking port 1433 or application layer traffic that bares the marks of Telnet. Try another PC or device on the same LAN, like a smart phone, to narrow the possibilities down.

Wesley
  • 32,690
  • 9
  • 82
  • 117
1

I spent two days to troubleshoot the same problem: telnet to port 1433 failed. After grabbing a lot of hairs, finally I found the problem!

The problem is that the server Internet connection is identified as "Public network", while it should be a domain network.

After restart the NLA service(refer to Domain Controller thinks its on a Public Network), the network is identified as domain network again, and then the problem is gone. My firewall setting is set to "Domain" profile, when it is a public network, the firewall setting does not work.

I hope this information will be helpful for someone else.

qiuyl
  • 11
  • 1
0

just to be sure what does the following query returns

declare @dir nvarchar(4000)    

exec master.dbo.xp_instance_regread
    N'HKEY_LOCAL_MACHINE',
    N'SOFTWARE\Microsoft\MSSQLServer\SuperSocketNetLib\Tcp\IPAll',
    N'TcpDynamicPorts', 
    @dir output

select @dir

or, after editing your instance name

declare @dir nvarchar(4000)

exec master.dbo.xp_regread
    N'HKEY_LOCAL_MACHINE',
    N'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.SQL110EXP02\MSSQLServer\SuperSocketNetLib\Tcp\IPAll',
    N'TcpDynamicPorts', 
    @dir output

select @dir
tschmit007
  • 146
  • 5