导致 "Destination Host Unreachable" 的 ping 间隔多长时间?

How long is the interval for a ping that results in "Destination Host Unreachable"?

是否设置了 ping 等待返回的时长 "Destination Host Unreachable"?如果我知道发出 ping 的时间,我想计算得到第一个 ack 需要多长时间。

From host-redacted.com (ip.redacted) icmp_seq=1006 Destination Host Unreachable
From host-redacted.com (ip.redacted) icmp_seq=1007 Destination Host Unreachable
64 bytes from host-redacted.com (ip.redacted): icmp_seq=1008 ttl=64 time=977 ms
64 bytes from host-redacted.com (ip.redacted): icmp_seq=1009 ttl=64 time=0.121 ms

这取决于您的 OS,但我相信很多系统都使用 1000ms 作为 ping 的默认超时。

在 windows 上,ping 命令接受一个参数 ping -w X,其中 X 是以毫秒为单位的超时。

在许多 linux 发行版中,您可以使用 ping -t X 来修改超时。

来自man page

-W timeout Time to wait for a response, in seconds. The option affects only timeout in absense of any responses, otherwise ping waits for two RTTs.

RTT = 往返时间。好像没有固定值,要看你的网络配置。

"Destination host unreachable" 表示路由问题,而不是超时问题:发送方和目的地之间的某个节点 不知道如何将数据包路由到该目的地 。等待更长的时间无济于事,您必须诊断或更正路由问题。