假设你发送一个 ping 请求,请求的 IP 地址是:ping 10.23.14.115
。预期输出应该是什么?你应该得到一些非常简短的输出,例如:
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Ping Statistics for 10.23.14.115
或者类似这样的长内容:
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Reply from 10.23.14.115, bytes -, ..
Ping Statistics for 10.23.14.115
如果使用一台计算机得到较长的结果而使用另一台计算机得到较短的结果,会发生什么情况?
答案1
取决于您使用哪个系统和哪个 ping 实现。
在 Windows 上,默认情况下ping
仅发送 4 个数据包。因此,您会收到 4 个响应,就像您给出的第一个示例一样。如果您这样做ping -t some-host
,它会继续 ping,直到您使用 停止它CTRL+C
。您通常希望在重新启动服务器时执行此操作,ping -t your-server
这样您就可以在服务器联机后立即知道。
在 Linux 上,我相信默认情况下ping
会持续 ping 主机直到您停止它。