◆traceroute
あるホストまでのネットワーク経路を確認するコマンド
簡易マニュアル
[root@localhost ~]#traceroute --help
Usage:
traceroute [ -46dFITUnrAV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w waittime ] [ -q nqueries ] [ -s src_addr ] [ -z sendwait ] host [ packetlen ]
Options:
-4 Use IPv4
-6 Use IPv6
-d --debug Enable socket level debugging
-F --dont-fragment Set DF (don't fragment bit) on
-f first_ttl --first=first_ttl
Start from the first_ttl hop (instead from 1)
-g gate,... --gateway=gate,...
Route packets throw the specified gateway
(maximum 8 for IPv4 and 127 for IPv6)
-I --icmp Use ICMP ECHO for tracerouting
-T --tcp Use TCP SYN for tracerouting
-U --udp Use UDP datagram (default) for tracerouting
-i device --interface=device
Specify a network interface to operate with
-m max_ttl --max-hops=max_ttl
Set the max number of hops (max TTL to be
reached). Default is 30
-N squeries --sim-queries=squeries
Set the number of probes to be tried
simultaneously (default is 16)
-n Do not resolve IP addresses to their domain names
-p port --port=port Use destination port port. It is an initial value
for the UDP destination port (incremented by each
probe, default is 33434), for the ICMP seq number
(incremented as well, default from 1), and the
constant destination port for TCP tries (default
is 80)
-t tos --tos=tos Set the TOS (IPv4 type of service) or TC (IPv6
traffic class) value for outgoing packets
-l flow_label --flowlabel=flow_label
Use specified flow_label for IPv6 packets
-w waittime --wait=waittime
Set the number of seconds to wait for response to
a probe (default is 5.0). Non-integer (float
point) values allowed too
-q nqueries --queries=nqueries
Set the number of probes per each hop. Default is
3
-r Bypass the normal routing and send directly to a
host on an attached network
-s src_addr --source=src_addr
Use source src_addr for outgoing packets
-z sendwait --sendwait=sendwait
Minimal time interval between probes (default 0).
If the value is more than 10, then it specifies a
number in milliseconds, else it is a number of
seconds (float point values allowed too)
-A --as-path-lookups Perform AS path lookups in routing registries and
print results directly after the corresponding
addresses
-V --version Print version info and exit
--help Read this help and exit
Arguments:
+ host The host to traceroute to
packetlen Specify an alternate probe packet length (default is 40).
Useless for TCP SYN
使用例
自宅からyahoo.co.jpまでの経路を確認してみる。
[root@localhost ~]#traceroute yahoo.co.jp
traceroute to yahoo.co.jp (203.216.227.176), 30 hops max, 40 byte packets
1 . (192.168.11.1) 0.351 ms 0.468 ms 0.628 ms
2 192.168.0.1 (192.168.0.1) 8.220 ms 8.387 ms 8.554 ms
~省略~
自宅のプロバイダが表示されていたので。。。
8 202.93.74.223 (202.93.74.223) 20.139 ms 16.399 ms 18.714 ms
9 203.216.238.242 (203.216.238.242) 20.491 ms 21.112 ms 21.543 ms
10 203.216.238.242 (203.216.238.242) 18.974 ms !X * *
※tracerouteは同じTTLでUDPデータグラムを3つ送信するため、
実行結果には3パケット分の往復時間が表示されます。
なんか途中で止まってしまいましたね。
試しに-Iオプションを使ってICMPでtracerouteを実施してみる。
[root@localhost ~]#traceroute yahoo.co.jp -I
traceroute to yahoo.co.jp (124.83.139.192), 30 hops max, 40 byte packets
1 . (192.168.11.1) 0.308 ms 0.454 ms 0.598 ms
2 192.168.0.1 (192.168.0.1) 3.628 ms 3.804 ms 3.979 ms
~省略~
自宅のプロバイダが表示されていたので。。。
8 STOrk-08P14-1.nw.odn.ad.jp (143.90.160.185) 18.991 ms 15.450 ms 17.768 ms
9 TYOrk-05P9-0.nw.odn.ad.jp (143.90.149.113) 27.099 ms 25.131 ms 25.527 ms
10 TYOrw-11T1-4.nw.odn.ad.jp (143.90.192.2) 27.937 ms 25.584 ms 26.176 ms
11 106.211131232.odn.ne.jp (211.131.232.106) 27.318 ms 25.674 ms 26.102 ms
12 124.83.128.30 (124.83.128.30) 30.143 ms 30.623 ms 31.879 ms
13 124.83.128.50 (124.83.128.50) 32.867 ms 34.252 ms 35.271 ms
14 yahoo.co.jp (124.83.139.192) 37.869 ms 39.511 ms 40.231 ms
ちゃんと届いたみたいですね。