IOS Ping 使いこなし
Ping が通らないよ〜
ネットワークエンジニアでPing を知らない人は恐らくいないでしょう。
Ping は最も基本的なネットワーク診断ツールです。
Windows、UNIX、Mac OS・・・Ping を実装していないOS は見当たりません。ほとんどのネットワーク機器にもPing は実装されており、Cisco のIOS も例外ではありません。
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.83.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/24/32 ms
Router#
宛先を指定してPing を実行すると、IP の到達性(Reachability)を確認することが出来ます。
上記の例のように宛先IP アドレスだけを指定することも出来ますが、いつもはEnter を連打するだけで通過しているオプションを使うことで、よりキメの細かいテストが出来ます。
Protocol [ip]:
Target IP address: 10.33.5.1
Repeat count [5]: 10
Datagram size [100]: 500
Timeout in seconds [2]: 1
Extended commands [n]: y
Source address or interface: 192.168.1.1
Type of service [0]: 2
Set DF bit in IP header? [no]: yes
Validate reply data? [no]: no
Data pattern [0xABCD]:
オプションを入力していくと、次の選択肢が現れます。
ここでは、IP ヘッダーのオプションフィールドを使った拡張機能を指定します。
Loose オプションを使うと、宛先へ到達するまでの経路を指定することが出来ます。
指定された経路が不通の場合、代替経路を探してくれます。
Windows のPing で指定する-j オプションと同等です。
Source route: 192.168.12.67 192.168.83.1
Loose, Strict, Record, Timestamp, Verbose[LV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.33.5.1, timeout is 2 seconds:
Packet has IP options: Total option bytes= 11, padded length=12
Loose source route: <*>
(192.168.12.67)
(192.168.83.1)
Reply to request 0 (88 ms). Received packet has options
Total option bytes= 12, padded length=12
Loose source route:
(192.168.83.1)
(192.168.12.67)
<*>
End of list
<省略>
Reply to request 4 (60 ms). Received packet has options
Total option bytes= 12, padded length=12
Loose source route:
(192.168.83.1)
(192.168.12.67)
<*>
End of list
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/67/88 ms
Router#
Strict オプションの使い方はLoose オプションと同じですが、指定した経路を経由して宛先に到達できない場合にはUnreachable となります。
Windows のPing で指定する-k オプションと同等です。
Source route: 192.168.12.67 192.168.83.1
Loose, Strict, Record, Timestamp, Verbose[SV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.33.5.1, timeout is 2 seconds:
Packet has IP options: Total option bytes= 11, padded length=12
Strict source route: <*>
(192.168.12.67)
(192.168.83.1)
Unreachable from 192.168.12.67. Received packet has options
Total option bytes= 11, padded length=12
Strict source route: <*>
(192.168.12.67)
(192.168.83.1)
<省略>
Success rate is 0 percent (0/5)
Router#
Record オプションを指定すると、ICMP Echo Request が宛先に到達し、Echo Reply が戻ってくるまでに通過したルータのアドレスを取得する事が出来ます。
Windows のPing で指定する-r オプションと同等です。
Number of hops [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[RV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.33.5.1, timeout is 2 seconds:
Packet has IP options: Total option bytes= 39, padded length=40
Record route: <*>
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
Reply to request 0 (40 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(192.168.12.66)
(192.168.83.3)
(10.33.5.1)
(192.168.83.1)
(192.168.12.65)
(192.168.12.66) <*>
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
End of list
<省略>
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/40 ms
Router#
Timestamp オプションを指定すると、途中のルータを通過した時刻を知ることが出来ます。
Windows のPing で指定する-s オプションと同等です。
Number of timestamps [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[TV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.33.5.1, timeout is 2 seconds:
Packet has IP options: Total option bytes= 40, padded length=40
Timestamp: Type 0. Overflows: 0 length 40, ptr 5
>>Current pointer<<
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Reply to request 0 (52 ms). Received packet has options
Total option bytes= 40, padded length=40
Timestamp: Type 0. Overflows: 0 length 40, ptr 29
Time=*20:54:03.903 PST (810D397F)
Time=*20:54:03.915 PST (810D398B)
Time=*20:54:03.627 PST (810D386B)
Time=*20:54:03.627 PST (810D386B)
Time=*20:54:03.935 PST (810D399F)
Time=*20:54:03.955 PST (810D39B3)
>>Current pointer<<
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
Time= 16:00:00.000 PST (00000000)
<省略>
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/42/52 ms
Router#
Verbose とは何でしょうか?これまで見てきたLoose やStric オプションを実行した時にも勝手に入っていました。
Verbose とは、「多弁な」とか「くどい」という意味の英単語です。
単に宛先を指定してPing を実行すると、!!!!! としか出てきませんでしたが、Verbose を指定するとPing 毎のRTT (Round Trip time = 往復遅延時間)を知ることが出来ます。
Loose, Strict, Record, Timestamp, Verbose[V]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.33.5.1, timeout is 2 seconds:
Reply to request 0 (20 ms)
Reply to request 1 (20 ms)
Reply to request 2 (20 ms)
Reply to request 3 (20 ms)
Reply to request 4 (20 ms)
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms
Router#
Verbose モードは、Loose やStric といった拡張機能を指定すると、自動的に有効となります。
ネットワークエンジニアになろう!のトップページへ戻る