Ping

為什麼 ping 起作用時“ping -l”不起作用?

  • October 16, 2017

我可以ping通

ping AddressIp
64 bytes from indirizzoIp: icmp_req=1 ttl=42 time=149 ms

但有附加參數

ping AddressIp -l 1400 
ping: cannot set preload to value > 3

ping AddressIp -t -l 1400
ping: can't set unicast time-to-live: Invalid argument

為什麼我ping不通?

ping AddressIp -l 1400 
ping: cannot set preload to value > 3

您需要超級使用者權限才能訪問ping值大於 3 的此功能。

嘗試:

sudo ping AddressIp -l 1400

更新:

您想要ping數據包的“大小”選項嗎?我想,在 Windows 中選項-l意味著“數據包的大小”,但在 Linux 中還有另一個選項。

嘗試-s選項:

sudo ping  AddressIp  -s 1000 -l 1400

德貝內斯

在 Linuxping中會一直執行,直到您停止它,因此您不需要 Windows-t選項。

來自ping's manpage

-l preload
      If  preload is specified, ping sends that many packets not waiting 
      for reply.  Only the super-user may select preload more than 3.

-p pattern
      You may specify up to 16 ``pad'' bytes to fill  out  the  packet
      you send.  This is useful for diagnosing data-dependent problems
      in a network.  For example, -p ff will cause the sent packet  to
      be filled with all ones.

因此,請確保您在超級使用者下執行 ping 並輸入-p選項參數。

引用自:https://unix.stackexchange.com/questions/86103