【问题标题】:How to check whether network connection to port is not open, or nothing is listening at that port?如何检查到端口的网络连接是否未打开,或者该端口没有监听?
【发布时间】:2013-10-16 19:03:46
【问题描述】:

我总是使用 telnet [IP] [端口] 检查网络连接。但是,有时连接会超时,因为没有任何东西在监听该端口,但到该端口的隧道是打开的。如何检查差异,即 telnet 超时是因为隧道未打开还是因为没有东西在另一端监听该端口?

【问题讨论】:

  • 我们能否假设网络或目标上没有防火墙
  • 网络开放应该在防火墙上进行,所以是有防火墙
  • 连接超时并不意味着没有监听。这会导致“连接被拒绝”。

标签: networking telnet


【解决方案1】:

可能通过使用手册页中的 tcptraceroute

   This program attempts to trace the route an IP packet would  follow  to
   some internet host by launching probe packets with a small ttl (time to
   live) then listening for an ICMP "time exceeded" reply from a  gateway.
   We  start our probes with a ttl of one and increase by one until we get
   an ICMP "port unreachable" (or TCP reset)

将 max_ttl 值设置为适合您的防火墙

【讨论】:

    猜你喜欢
    • 2013-10-12
    • 2012-05-01
    • 2012-10-29
    • 2012-02-14
    • 2012-06-09
    • 2012-08-03
    相关资源
    最近更新 更多