1traceroute(1M) System Administration Commands traceroute(1M)
2
3
4
6 traceroute - print the route packets take to network host
7
9 traceroute [-adFIlnSvx] [-A addr_family] [-c traffic_class]
10 [-f first_hop] [-g gateway [-g gateway...] | -r]
11 [-i iface] [-L flow_label] [-m max_hop]
12 [-P pause_sec] [-p port] [-Q max_timeout]
13 [-q nqueries] [-s src_addr] [-t tos] [-w wait_time] host
14 [packetlen]
15
16
18 The Internet is a large and complex aggregation of network hardware,
19 connected by gateways. Tracking the route a packet follows can be dif‐
20 ficult. The utility traceroute traces the route that an IP packet fol‐
21 lows to another internet host.
22
23
24 The traceroute utility utilizes the both the IPv4 and IPv6 protocols.
25 Use the -A option to override the default behavior. traceroute uses the
26 IPv4 protocol ttl (time to live) field or the IPv6 field hop limit. It
27 attempts to elicit an ICMP or ICMP6 TIME_EXCEEDED response from each
28 gateway along the path, and a PORT_UNREACHABLE(or ECHO_REPLY if -I is
29 used) response from the destination host. It starts by sending probes
30 with a ttl or hop limit of 1 and increases by 1 until it either gets to
31 the host, or it hits the maximum max_hop. The default maximum max_hop
32 is 30 hops, but this can be set by the -m option.
33
34
35 Three probes are sent at each ttl (hop limit) setting, and a line is
36 printed showing the ttl (hop limit), the hostname and the address of
37 the gateway, and the rtt (round trip time) of each probe. The number of
38 probes may be specifically set using the -q option. If the probe
39 answers come from different gateways, the hostname and the address of
40 each responding system will be printed. If there is no response within
41 a 5 second timeout interval, an asterisk (*) is displayed for that
42 probe. The -w option may be used to set the timeout interval. Other
43 possible annotations that may appear after the time are:
44
45 !
46
47 the ttl (hop limit) value in the received packet is <= 1.
48
49
50 !H
51
52 host unreachable.
53
54
55 !X
56
57 communication administratively prohibited.
58
59
60 <!N>
61
62 ICMP (ICMP6) unreachable code N.
63
64
65
66 The following annotations appear only for IPv4:
67
68 !F
69
70 fragmentation needed. This should never occur. If this is seen, the
71 associated gateway is broken.
72
73
74 !N
75
76 network unreachable.
77
78
79 !P
80
81 protocol unreachable.
82
83
84 !S
85
86 source route failed. It is likely that the gateway does not support
87 source routing.
88
89
90 !T
91
92 unreachable for the specified tos (type-of-service).
93
94
95 !U
96
97 source host isolated or precedence problem.
98
99
100
101 The following annotations appear only for IPv6:
102
103 !A
104
105 host unreachable for a reason other than lack of an entry in the
106 routing table.
107
108
109 !B
110
111 packet too big.
112
113
114 !E
115
116 destination is not a neighbor.
117
118
119 !R
120
121 unrecognized next header.
122
123
124
125 If almost all the probes result in some kind of unreachable code, then
126 traceroute gives up and exits.
127
128
129 The destination host is not supposed to process the UDP probe packets,
130 so the destination port default is set to an unlikely value. However,
131 if some application on the destination is using that value, the value
132 of port can be changed with the -p option.
133
134
135 The only mandatory parameter is the destination host name or IP number.
136 The default probe datagram length is 40 bytes (60 bytes for IPv6), but
137 this may be increased by specifying a packet length (in bytes) after
138 the destination host name.
139
140
141 All integer arguments to traceroute can be specified in either decimal
142 or hexadecimal notation. For example, packetlen can be specified either
143 as 256 or 0x100.
144
146 -A addr_family
147
148 Specify the address family of the target host. addr_family can be
149 either inet or inet6. Address family determines which protocol to
150 use. For an argument of inet, IPv4 is used. For inet6, IPv6 is
151 used.
152
153 By default, if the name of a host is provided, not the literal IP
154 address, and a valid IPv6 address exists in the name service data‐
155 base, traceroute will use this address. Otherwise, if the name ser‐
156 vice database contains an IPv4 address, it will try the IPv4
157 address.
158
159 Specify the address family inet or inet6 to override the default
160 behavior. If the argument specified is inet, traceroute will use
161 the IPv4 address associated with the hostname. If none exists,
162 traceroute will state that the host is unknown and exit. It will
163 not try to determine if an IPv6 address exists in the name service
164 database.
165
166 If the specified argument is inet6, traceroute will use the IPv6
167 address that is associated with the hostname. If none exists,
168 traceroute will state that the host is unknown and exit.
169
170
171 -a
172
173 Probe all of the addresses of a multi-homed destination. The output
174 looks like traceroute has been run once for each IP address of the
175 destination. If this option is used together with -A, traceroute
176 probes only the addresses that are of the specified address family.
177 While probing one of the addresses of the destination, user can
178 skip to the next address by sending a SIGINT, or exit traceroute by
179 sending a SIGQUIT signal. See signal(3C)
180
181
182 -c traffic_class
183
184 Specify the traffic class of probe packets. The value must be an
185 integer in the range from 0 to 255. Gateways along the path may
186 route the probe packet differently depending upon the value of
187 traffic_class set in the probe packet. This option is valid only on
188 IPv6.
189
190
191 -d
192
193 Set the SO_DEBUG socket option.
194
195
196 -F
197
198 Set the "don't fragment" bit. This option is valid only on IPv4.
199 When specified from within a shared-IP zone, this option has no
200 effect as the "don't fragment" bit is always set in this case.
201
202
203 -f first_hop
204
205 Set the starting ttl ( hop limit) value to first_hop, to override
206 the default value 1. traceroute skips processing for those interme‐
207 diate gateways which are less than first_hop hops away.
208
209
210 -g gateway
211
212 Specify a loose source route gateway. The user can specify more
213 than one gateway by using -g for each gateway. The maximum number
214 of gateways is 8 for IPv4 and 127 for IPv6. Note that some factors
215 such as the link MTU can further limit the number of gateways for
216 IPv6. This option cannot be used with the -r option.
217
218 Only users with the {PRIV_NET_RAWACCESS} privilege can specify a
219 loose source route with this option.
220
221
222 -I
223
224 Use ICMP (ICMP6) ECHO instead of UDP datagrams.
225
226
227 -i iface
228
229 For IPv4, this option specifies a network interface to obtain the
230 source IP address. This is normally only useful on a multi-homed
231 host. The -s option is also another way to do this. For IPv6, it
232 specifies the network interface on which probe packets are trans‐
233 mitted. The argument can be either an interface index, for example,
234 1, 2, or an interface name, for example, eri0, hme0.
235
236
237 -L flow_label
238
239 Specify the flow label of probe packets. The value must be an inte‐
240 ger in the range from 0 to 1048575. This option is valid only on
241 IPv6.
242
243
244 -l
245
246 Print the value of the ttl (hop limit) field in each packet
247 received.
248
249
250 -m max_hop
251
252 Set the maximum ttl (hop limit) used in outgoing probe packets. The
253 default is 30 hops, which is the same default used for TCP connec‐
254 tions.
255
256
257 -n
258
259 Print hop addresses numerically rather than symbolically and numer‐
260 ically. This saves a nameserver address-to-name lookup for each
261 gateway found on the path.
262
263
264 -P pause_sec
265
266 Specify a delay, in seconds, to pause between probe packets. This
267 may be necessary if the final destination does not accept undeliv‐
268 erable packets in bursts. By default, traceroute sends the next
269 probe as soon as it has received a reply. Note that pause_sec is a
270 real number.
271
272
273 -p port
274
275 Set the base UDP port number used in probes.The default is 33434.
276 traceroute hopes that nothing is listening on UDP ports
277 (base+(nhops-1)*nqueries) to (base+(nhops*nqueries)-1)at the desti‐
278 nation host, so that an ICMP (ICMP6) PORT_UNREACHABLE message will
279 be returned to terminate the route tracing. If something is listen‐
280 ing on a port in the default range, this option can be used to
281 select an unused port range. nhops is defined as the number of hops
282 between the source and the destination.
283
284
285 -Q max_timeout
286
287 Stop probing this hop after max_timeout consecutive timeouts are
288 detected. The default value is 5. Useful in combination with the -q
289 option if you have specified a large nqueries probe count.
290
291
292 -q nqueries
293
294 Set the desired number of probe queries. The default is 3.
295
296
297 -r
298
299 Bypass the normal routing tables and send directly to a host on an
300 attached network. If the host is not on a directly-attached net‐
301 work, an error is returned. This option can be used to send probes
302 to a local host through an interface that has been dropped by the
303 router deamon. See in.routed(1M). You cannot use this option if the
304 -g option is used.
305
306
307 -S
308
309 Display a summary of how many probes were not answered for each
310 hop.
311
312
313 -s src_addr
314
315 Use the following address, which usually is given as a literal IP
316 address, not a hostname, as the source address in outgoing probe
317 packets. On multi-homed hosts, those with more than one IP address,
318 this option can be used to force the source address to be something
319 other than the IP address traceroute picks by default. If the IP
320 address is not one of this machine's interface addresses, an error
321 is returned and nothing is sent. For IPv4, when used together with
322 the -i option, the given IP address should be configured on the
323 specified interface. Otherwise, an error will be returned. In the
324 case of IPv6, the interface name and the source address do not have
325 to match.
326
327
328 -t tos
329
330 Set the tos(type-of-service) in probe packets to the specified
331 value. The default is zero. The value must be an integer in the
332 range from 0 to 255. Gateways along the path may route the probe
333 packet differently depending upon the tos value set in the probe
334 packet. This option is valid only on IPv4.
335
336
337 -v
338
339 Verbose output. For each hop, the size and the destination of the
340 response packets is displayed. Also ICMP (ICMP6) packets received
341 other than TIME_EXCEEDED and UNREACHABLE are listed as well.
342
343
344 -w waittime
345
346 Set the time, in seconds, to wait for a response to a probe. The
347 default is 5 seconds.
348
349
350 -x
351
352 Prevent traceroute from calculating checksums. Checksums are usu‐
353 ally required for the last hop when using ICMP ECHO probes. This
354 option is valid only on IPv4. See the -I option.
355
356 When specified from within a shared-IP zone, this option has no
357 effect as the checksum is always calculated by the operating sys‐
358 tem in this case.
359
360
362 The following operands are supported:
363
364 host
365
366 The network host.
367
368
370 Example 1 Sample Output From the traceroute Utility
371
372
373 Some sample output from the traceroute utility might be:
374
375
376 istanbul% traceroute london
377 traceroute: Warning: london has multiple addresses; \
378 using 4::114:a00:20ff:ab3d:83ed
379 traceroute: Warning: Multiple interfaces found; \
380 using 4::56:a00:20ff:fe93:8dde @ eri0:2
381 traceroute to london (4::114:a00:20ff:ab3d:83ed), 30 hops max, \
382 60 byte packets
383 1 frbldg7c-86 (4::56:a00:20ff:fe1f:65a1) 1.786 ms 1.544 ms 1.719 ms
384 2 frbldg7b-77 (4::255:0:0:c0a8:517) 2.587 ms 3.001 ms 2.988 ms
385 3 london (4::114:a00:20ff:ab3d:83ed) 3.122 ms 2.744 ms 3.356 ms
386
387
388
389
390 The target host, london, has both IPv4 and IPv6 addresses in the name
391 service database. According to the default behavior, traceroute uses
392 IPv6 address of the destination host.
393
394
395 Example 2 Using the traceroute Utility For a Host Which has Only IPv4
396 Addresses
397
398
399 In the following examples, traceroute is tracking the route to host
400 sanfrancisco, which has only IPv4 addresses in the name service data‐
401 base. Therefore traceroute uses only IPv4 addresses. The following
402 shows the 7-hop path that a packet would follow from the host istanbul
403 to the host sanfrancisco.
404
405
406 istanbul% traceroute sanfrancisco
407 traceroute: Warning: Multiple interfaces found; using 172.31.86.247 @eri0
408 traceroute to sanfrancisco (172.29.64.39), 30 hops max, 40 byte packets
409 1 frbldg7c-86 (172.31.86.1) 1.516 ms 1.283 ms 1.362 ms
410 2 bldg1a-001 (172.31.1.211) 2.277 ms 1.773 ms 2.186 ms
411 3 bldg4-bldg1 (172.30.4.42) 1.978 ms 1.986 ms 13.996 ms
412 4 bldg6-bldg4 (172.30.4.49) 2.655 ms 3.042 ms 2.344 ms
413 5 ferbldg11a-001 (172.29.1.236) 2.636 ms 3.432 ms 3.830 ms
414 6 frbldg12b-153 (172.29.153.72) 3.452 ms 3.146 ms 2.962 ms
415 7 sanfrancisco (172.29.64.39) 3.430 ms 3.312 ms 3.451 ms
416
417
418
419 Example 3 Using the traceroute Utility With Source Routing
420
421
422 The following example shows the path of a packet that goes from istan‐
423 bul to sanfrancisco through the hosts cairo and paris, as specified by
424 the -g option. The -I option makes traceroute send ICMP ECHO probes to
425 the host sanfrancisco. The -i options sets the source address to the IP
426 address configured on the interface qe0.
427
428
429 istanbul% traceroute -g cairo -g paris -i qe0 -q 1 -I sanfrancisco
430 traceroute to sanfrancisco (172.29.64.39), 30 hops max, 56 byte packets
431 1 frbldg7c-86 (172.31.86.1) 2.012 ms
432 2 flrbldg7u (172.31.17.131) 4.960 ms
433 3 cairo (192.168.163.175) 4.894 ms
434 4 flrbldg7u (172.31.17.131) 3.475 ms
435 5 frbldg7c-017 (172.31.17.83) 4.126 ms
436 6 paris (172.31.86.31) 4.086 ms
437 7 frbldg7b-82 (172.31.82.1) 6.454 ms
438 8 bldg1a-001 (172.31.1.211) 6.541 ms
439 9 bldg6-bldg4 (172.30.4.49) 6.518 ms
440 10 ferbldg11a-001 (172.29.1.236) 9.108 ms
441 11 frbldg12b-153 (172.29.153.72) 9.634 ms
442 12 sanfrancisco (172.29.64.39) 14.631 ms
443
444
445
446
447
449 The following exit values are returned:
450
451 0
452
453 Successful operation.
454
455
456 >0
457
458 An error occurred.
459
460
462 See attributes(5) for descriptions of the following attributes:
463
464
465
466
467 ┌─────────────────────────────┬─────────────────────────────┐
468 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
469 ├─────────────────────────────┼─────────────────────────────┤
470 │Availability │SUNWcsu │
471 └─────────────────────────────┴─────────────────────────────┘
472
474 netstat(1M), signal(3C), ping(1M), attributes(5), privileges(5),
475 zones(5)
476
478 This utility is intended for use in network testing, measurement and
479 management. It should be used primarily for manual fault isolation.
480 Because of the load it could impose on the network, it is unwise to use
481 traceroute(1M) during normal operations or from automated scripts.
482
483
484
485SunOS 5.11 18 Sep 2008 traceroute(1M)