如何确定Windows服务器上是否打开了端口? [英] How do I determine if a port is open on a Windows server?
问题描述
我正在尝试将站点安装在服务器上的备用端口下,但是该端口可能已被防火墙关闭.有没有一种方法可以在特定端口上ping出或输入,以查看它是否打开?
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?
推荐答案
假定您要使用的是TCP(而不是UDP)端口:
Assuming that it's a TCP (rather than UDP) port that you're trying to use:
-
在服务器本身上,使用
netstat -an
检查哪些端口正在侦听.
On the server itself, use
netstat -an
to check to see which ports are listening.
从外部,只需使用telnet host port
(在Unix系统上为telnet host:port
)来查看连接是否被拒绝,接受或超时.
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
在Windows 7或Windows Vista上,默认选项'telnet'不被识别为内部或外部命令,可操作程序或批处理文件.要解决此问题,只需启用它:单击*开始**→. 控制面板→ 程序→ 打开或关闭Windows功能.在列表中,向下滚动并选择 Telnet Client ,然后单击 OK .
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 Panel → Programs → Turn Windows Features on or off. In the list, scroll down and select Telnet Client and click OK.
这篇关于如何确定Windows服务器上是否打开了端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!