ping
ICMP ECHO_REQUEST パケットをネットワーク上の対象ホストに送って、ホストの生存確認を行う
- 応答は、ECHO_REPLY
デフォルトでは SIGABORT を受信するまで ICMP パケットの送信と受信を繰り返すので Ctr+c で切り上げる
オプション
オプション 用途 -A 200msでの計測 -c [回数] 回数セット -i [インターバル チェック間隔 -n 名前解決しない sample
$ ping google.co.jp PING google.co.jp (172.217.26.3): 56 data bytes 64 bytes from 172.217.26.3: icmp_seq=0 ttl=52 time=8.552 ms 64 bytes from 172.217.26.3: icmp_seq=1 ttl=52 time=8.251 ms 64 bytes from 172.217.26.3: icmp_seq=2 ttl=52 time=7.456 ms 64 bytes from 172.217.26.3: icmp_seq=3 ttl=52 time=9.228 ms 64 bytes from 172.217.26.3: icmp_seq=4 ttl=52 time=7.837 ms ^C --- google.co.jp ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 7.456/8.265/9.228/0.608 ms
- 56 data bytes のパケットを google.co.jp に送る
TTL を 5 にしてみる
# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) # ping -c 3 -t 5 google.co.jp PING google.co.jp (216.58.197.195) 56(84) bytes of data. From 118.23.10.85 (118.23.10.85) icmp_seq=1 Time to live exceeded From 118.23.10.85 (118.23.10.85) icmp_seq=2 Time to live exceeded From 118.23.10.85 (118.23.10.85) icmp_seq=3 Time to live exceeded --- google.co.jp ping statistics --- 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2002ms