Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine if a port is open on a Windows server? [closed]

I'm trying to install a site under an alternative port on a server, but the port may be closed by a firewall. Is there a way to ping out or in, on a specific port, to see if it is open?

like image 845
Jason Avatar asked Nov 07 '08 18:11

Jason


People also ask

How can I tell if a port is open or closed Windows?

Type "Network Utility" in the search field and select Network Utility. Select Port Scan, enter an IP address or hostname in the text field, and specify a port range. Click Scan to begin the test. If a TCP port is open, it will be displayed here.


2 Answers

On Windows you can use

netstat -na | find "your_port" 

to narrow down the results. You can also filter for LISTENING, ESTABLISHED, TCP and such. Mind it's case-sensitive though.

like image 45
J.Celmer Avatar answered Oct 08 '22 16:10

J.Celmer


Assuming that it's a TCP (rather than UDP) port that you're trying to use:

  1. On the server itself, use netstat -an to check to see which ports are listening.

  2. From outside, just use telnet host port (or telnet host:port on Unix systems) to see if the connection is refused, accepted, or timeouts.

On that latter test, then in general:

  • connection refused means that nothing is running on that port
  • accepted means that something is running on that port
  • timeout means that a firewall is blocking access

On Windows 7 or Windows Vista the default option 'telnet' is not recognized as an internal or external command, operable program or batch file. To solve this, just enable it: Click *Start** → Control PanelProgramsTurn Windows Features on or off. In the list, scroll down and select Telnet Client and click OK.

like image 197
Alnitak Avatar answered Oct 08 '22 18:10

Alnitak