Where to start First steps track · 15 stages
Linux Labs

ping — check whether packets reach a host

cheat sheet · Ubuntu 24.04 · iputils 20240117 https://lab.dimsanych.ru/en/wiki/ping/

Cheat sheet

  • ping -c 3 192.0.2.1 three requests and a summary; else Ctrl+C
  • ping -c 3 -W 1 192.0.2.1 wait at most a second for each reply
  • ping -c 3 -n 192.0.2.1 no name lookups — faster and cleaner
  • ping -c 3 -I lab0 192.0.2.1 through a given interface
  • ping -c 10 -q 192.0.2.1 only the final statistics
  • ping -c 3 -O 192.0.2.1 report every request left unanswered
  • ping -4 -c 3 example.com IPv4 only; -6 for IPv6 only
  • sudo ip netns exec lab-client ping -c 2 192.0.2.1 from a namespace

Options

Without -c, Linux ping runs forever — unlike Windows, which sends four requests by default. Full list — man ping.

Loading…