iputils ping 中的 Windows ping -t(继续直到中断)是什么?

Sou*_*jit 1 windows ping

在 Windows 8 中,我曾经在运行中执行过:

ping 166.18.0.1 -t
Run Code Online (Sandbox Code Playgroud)

其中 166.18.0.1 是我的 DNS IP(假设)。

如何在 ubuntu 中做同样的事情?我已经在终端窗口中尝试过这个,但它显示一个错误:

option requires an argument t
Run Code Online (Sandbox Code Playgroud)

那么如何做到这一点呢?

hee*_*ayl 6

只会ping 166.18.0.1做。

在 Ubuntu 中,默认情况下ping会无限期地继续运行,除非您提到限制(通过-c选项),因此ping 166.18.0.1与 windows 相同ping 166.18.0.1 -t

在 Ubuntu 中,-t选项ping是设置一个 TTL 值,因为您插入了该-t选项而没有提供 TTL 值,您会收到错误消息,提示您需要为-t.

如果您需要将 ICMP 数据包大小从 64 字节更改为 32 字节:

ping -s 24 166.18.0.1
Run Code Online (Sandbox Code Playgroud)

由于添加了 8 字节 ICMP 标头,因此总数据包大小将为 24+8=32 字节。

检查man ping以获得更多想法。