TRACEROUTE(8) | Maintenance Commands and Procedures | TRACEROUTE(8) |
traceroute - print the route packets take to network host
traceroute [-adFIlnSvx] [-A addr_family] [-c traffic_class]
[-f first_hop] [-g gateway [-g gateway...] | -r]
[-i iface] [-L flow_label] [-m max_hop]
[-P pause_sec] [-p port] [-Q max_timeout]
[-q nqueries] [-s src_addr] [-t tos] [-w wait_time] host
[packetlen]
The Internet is a large and complex aggregation of network hardware, connected by gateways. Tracking the route a packet follows can be difficult. The utility traceroute traces the route that an IP packet follows to another internet host.
The traceroute utility utilizes the both the IPv4 and IPv6 protocols. Use the -A option to override the default behavior. traceroute uses the IPv4 protocol ttl (time to live) field or the IPv6 field hop limit. It attempts to elicit an ICMP or ICMP6 TIME_EXCEEDED response from each gateway along the path, and a PORT_UNREACHABLE(or ECHO_REPLY if -I is used) response from the destination host. It starts by sending probes with a ttl or hop limit of 1 and increases by 1 until it either gets to the host, or it hits the maximum max_hop. The default maximum max_hop is 30 hops, but this can be set by the -m option.
Three probes are sent at each ttl (hop limit) setting, and a line is printed showing the ttl (hop limit), the hostname and the address of the gateway, and the rtt (round trip time) of each probe. The number of probes may be specifically set using the -q option. If the probe answers come from different gateways, the hostname and the address of each responding system will be printed. If there is no response within a 5 second timeout interval, an asterisk (*) is displayed for that probe. The -w option may be used to set the timeout interval. Other possible annotations that may appear after the time are:
!
!H
!X
<!N>
The following annotations appear only for IPv4:
!F
!N
!P
!S
!T
!U
The following annotations appear only for IPv6:
!A
!B
!E
!R
If almost all the probes result in some kind of unreachable code, then traceroute gives up and exits.
The destination host is not supposed to process the UDP probe packets, so the destination port default is set to an unlikely value. However, if some application on the destination is using that value, the value of port can be changed with the -p option.
The only mandatory parameter is the destination host name or IP number. The default probe datagram length is 40 bytes (60 bytes for IPv6), but this may be increased by specifying a packet length (in bytes) after the destination host name.
All integer arguments to traceroute can be specified in either decimal or hexadecimal notation. For example, packetlen can be specified either as 256 or 0x100.
-A addr_family
By default, if the name of a host is provided, not the literal IP address, and a valid IPv6 address exists in the name service database, traceroute will use this address. Otherwise, if the name service database contains an IPv4 address, it will try the IPv4 address.
Specify the address family inet or inet6 to override the default behavior. If the argument specified is inet, traceroute will use the IPv4 address associated with the hostname. If none exists, traceroute will state that the host is unknown and exit. It will not try to determine if an IPv6 address exists in the name service database.
If the specified argument is inet6, traceroute will use the IPv6 address that is associated with the hostname. If none exists, traceroute will state that the host is unknown and exit.
-a
-c traffic_class
-d
-F
-f first_hop
-g gateway
Only users with the {PRIV_NET_RAWACCESS} privilege can specify a loose source route with this option.
-I
-i iface
-L flow_label
-l
-m max_hop
-n
-P pause_sec
-p port
-Q max_timeout
-q nqueries
-r
-S
-s src_addr
-t tos
-v
-w waittime
-x
When specified from within a shared-IP zone, this option has no effect as the checksum is always calculated by the operating system in this case.
The following operands are supported:
host
Example 1 Sample Output From the traceroute Utility
Some sample output from the traceroute utility might be:
istanbul% traceroute london traceroute: Warning: london has multiple addresses; \
using 4::114:a00:20ff:ab3d:83ed traceroute: Warning: Multiple interfaces found; \
using 4::56:a00:20ff:fe93:8dde @ eri0:2 traceroute to london (4::114:a00:20ff:ab3d:83ed), 30 hops max, \
60 byte packets 1 frbldg7c-86 (4::56:a00:20ff:fe1f:65a1) 1.786 ms 1.544 ms 1.719 ms 2 frbldg7b-77 (4::255:0:0:c0a8:517) 2.587 ms 3.001 ms 2.988 ms 3 london (4::114:a00:20ff:ab3d:83ed) 3.122 ms 2.744 ms 3.356 ms
The target host, london, has both IPv4 and IPv6 addresses in the name service database. According to the default behavior, traceroute uses IPv6 address of the destination host.
Example 2 Using the traceroute Utility For a Host Which has Only IPv4 Addresses
In the following examples, traceroute is tracking the route to host sanfrancisco, which has only IPv4 addresses in the name service database. Therefore traceroute uses only IPv4 addresses. The following shows the 7-hop path that a packet would follow from the host istanbul to the host sanfrancisco.
istanbul% traceroute sanfrancisco traceroute: Warning: Multiple interfaces found; using 172.31.86.247 @eri0 traceroute to sanfrancisco (172.29.64.39), 30 hops max, 40 byte packets 1 frbldg7c-86 (172.31.86.1) 1.516 ms 1.283 ms 1.362 ms 2 bldg1a-001 (172.31.1.211) 2.277 ms 1.773 ms 2.186 ms 3 bldg4-bldg1 (172.30.4.42) 1.978 ms 1.986 ms 13.996 ms 4 bldg6-bldg4 (172.30.4.49) 2.655 ms 3.042 ms 2.344 ms 5 ferbldg11a-001 (172.29.1.236) 2.636 ms 3.432 ms 3.830 ms 6 frbldg12b-153 (172.29.153.72) 3.452 ms 3.146 ms 2.962 ms 7 sanfrancisco (172.29.64.39) 3.430 ms 3.312 ms 3.451 ms
Example 3 Using the traceroute Utility With Source Routing
The following example shows the path of a packet that goes from istanbul to sanfrancisco through the hosts cairo and paris, as specified by the -g option. The -I option makes traceroute send ICMP ECHO probes to the host sanfrancisco. The -i options sets the source address to the IP address configured on the interface qe0.
istanbul% traceroute -g cairo -g paris -i qe0 -q 1 -I sanfrancisco traceroute to sanfrancisco (172.29.64.39), 30 hops max, 56 byte packets 1 frbldg7c-86 (172.31.86.1) 2.012 ms 2 flrbldg7u (172.31.17.131) 4.960 ms 3 cairo (192.168.163.175) 4.894 ms 4 flrbldg7u (172.31.17.131) 3.475 ms 5 frbldg7c-017 (172.31.17.83) 4.126 ms 6 paris (172.31.86.31) 4.086 ms 7 frbldg7b-82 (172.31.82.1) 6.454 ms 8 bldg1a-001 (172.31.1.211) 6.541 ms 9 bldg6-bldg4 (172.30.4.49) 6.518 ms 10 ferbldg11a-001 (172.29.1.236) 9.108 ms 11 frbldg12b-153 (172.29.153.72) 9.634 ms 12 sanfrancisco (172.29.64.39) 14.631 ms
The following exit values are returned:
0
>0
signal(3C), attributes(7), privileges(7), zones(7), netstat(8), ping(8)
This utility is intended for use in network testing, measurement and management. It should be used primarily for manual fault isolation. Because of the load it could impose on the network, it is unwise to use traceroute(8) during normal operations or from automated scripts.
June 13, 2021 | OmniOS |