6

Trying to open a hole on a windows box to access sql server.

How can I test to see if the port is open (without using sql to test a login etc.)

I'm looking for a more generic way of testing w/o involving sql server just to isolate that problem of not being able to connect i.e. is it a login issue or a connection/firewall issue.

user2659
  • 1,152
  • 4
  • 20
  • 32

3 Answers3

9

You can use a port scanning tool such as NMAP or just simply telnet to the port in question if it is a TCP port. telnet host port - Example would be telnet server01 1433

Kevin Garber
  • 311
  • 2
  • 3
  • Just today I installed telnet in win-7 just for this purpose. telnet still has its excellent uses. – nos Dec 08 '09 at 17:26
  • +1 I use PuTTY to make telnet connections on W7, since I already have it installed for SSH. Works great. – MDMarra Jul 28 '11 at 18:01
6

First I'd verify that the server in question is actually listening on 1443. Simplest way to do that is probably (on the server, in a cmd window) netstat -an | find "1443" and see what you get back.

Second, if it's a TCP connection you're looking for, you may be able to telnet <hostname> 1443 and see if you get a connection. You won't be able to do anything with it, but that should tell you if you can establish one.

If you're looking for UDP, I'd be surprised if you had a good way to establish a connection on a connectionless protocol.

fencepost
  • 972
  • 6
  • 10
0

If you want to verify that the port is open from the public internet, you could use a tool like https://www.monitostech.com/tool/port. This is particularly useful when testing whether a web server is accessible to the public, or if you have geographically dispersed systems, you can verify that the have an open path.

When checking connectivity between a web server and a SQL server on a local LAN, I find this powershell command to work quite well:

try { $cn=new-object System.Net.Sockets.TcpClient; $cn.connect("host",port); $cn.close() ; "Test worked" } catch { "Test failed" }

Jeff W.
  • 511
  • 2
  • 7