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.

  • I would verify that you mean 1443 and not 1433, which is the default for SQL. – Kevin Garber Dec 8 '09 at 16:48
  • actually it is 1433 – user2659 Dec 8 '09 at 17:36
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

| improve this answer | |
  • Just today I installed telnet in win-7 just for this purpose. telnet still has its excellent uses. – nos Dec 8 '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.

| improve this answer | |
  • I was just about to edit and add the netstat option as well - you beat me to it. :) – Kevin Garber Dec 8 '09 at 16:46
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" }

| improve this answer | |

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.