Previous | Contents | Index |
Displays the route that packets take to the network host.
traceroute [-m max_ttl] [-n] [-p port] [-q nqueries] [-r] [-s src_addr] [-v] [-w waittime] host [packetsize]
The Internet is a large and complex aggregation of network hardware connected together by gateways. The traceroute command tracks the route that packets follow from gateway to gateway. The command uses the IP protocol time-to-live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to a particular host.The only mandatory parameter is the destination host name or IP address. The default probe datagram length is 38 bytes, but you can increase this value by specifying a packet size (in bytes) after the destination host name. This is useful when the -f option is given for MTU discovery along the route. You should start with the maximum packet size for your own network interface (if the given value is even bigger, traceroute attempts to select a more appropriate value). If no packet size is given when using the -f option, traceroute determines the initial MTU automatically.
To track the route of an IP packet, traceroute launches UDP probe packets with a small TTL (time-to-live) and then listens for an ICMP "time exceeded" reply from a gateway. Probes start with a TTL of 1 and increment by one until either an ICMP "port unreachable" is returned (indicating that the packet reached the host) or until the maximum number of hops is exceeded (the default is 30 hops and can be changed with the -m option). At each TTL setting, three probes are launched (the number can be changed with the -q option), and traceroute displays a line showing the TTL, address of the gateway, and round-trip time of each probe. If the probe answers come from different gateways, traceroute displays the address of each responding system. If there is no response within a 3-second timeout interval (which can be changed with the -w option), traceroute displays an asterisk (*) for that probe.
To prevent the destination host from processing the UDP probe packets, the destination port is set to an unlikely value. If necessary, you can change the destination port valued with the -p option.
Note
This program 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, do not use traceroute during normal operations or from automated scripts.
-A
Looks up the AS-number (autonomous system) for each hop's network address at the whois server specified by the -h option.-a
If the destination host has multiple addresses, traceroute probes all addresses if this option is set. Normally, only the first address as returned by the resolver is attempted.-c stoptime
Specifies a delay (in seconds) to pause between probe packets. This can be necessary if the final destination is a router that does not accept undeliverable packets in bursts.-f
Disables IP fragmentation. If the given packet size is too big to be handled unfragmented by a machine along the route, a "fragmentation needed" status is returned, and the indicator !F is printed. If a gateway returns the proper MTU size to be used, traceroute automatically decreases the packet size to this new value. If the proper MTU size is not returned, traceroute chooses a smaller packet size.-g gateway
Enables the IP LSRR (loose source record route) option. This is useful for asking how somebody at the specified gateway reaches a particular target.-h server
Specifies the name or IP address of the whois server that is contacted for the AS-number lookup, if the -A option is given.-i initial_ttl
Sets the starting time-to-live value to initial_ttl , to override the default value of 1. Effectively this skips processing for intermediate hosts that are less than initial_ttl hops away.-k
Keeps the connection to the whois server permanently open. This speeds lookups considerably, because a connection setup for each individual lookup is not necessary. However, not all whois servers support this feature.-l
Prints the value of the TTL field in each packet received. (This flag can be used to help detect asymmetric routing.)-m max_ttl
Sets the maximum time-to-live (maximum number of hops) used in outgoing probe packets. The default is 30 hops, which is the same default used for TCP connections.-N
Displays the network name for each hop. If a BIND resolver cannot be reached, network names are retrieved just from the /etc/networks file.-n
Displays the hop IP addresses using dotted-decimal notation. This saves a name server address-to-name lookup for each gateway found on the path. It also prevents a reverse lookup for numeric dotted-quad addresses given on the command line, such as destination host or -g gateway addresses.-p port
Sets the base UDP port number used in probes. (The default value is 33434.) The traceroute command presumes that nothing is listening on UDP ports base to base+nhops-1 at the destination host (so an ICMP "port unreachable" message is returned to terminate the route tracing). If another process is listening on a port in the default range, use this option to pick an unused port range.-Q maxquit
Stops probing this hop after the number of consecutive timeouts specified by maxquit are detected. The default value is 5. Useful in combination with -S if you have specified a big nqueries probe count.-q nqueries
Sets the number of probes launched at each TTL setting. The default is 3.-r
Bypasses the normal routing tables and sends directly to a host on an attached network. If the host is not on a directly attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it (for example, after the interface was dropped by ROUTED or GATED).-S
Prints a summary of per-hop minimum/average/maximum rtt (round-trip time) statistics. This flag suppresses the per-probe rtt and TTL reporting. To obtain more detailed statistics, increase the default nqueries probe count. For more information, see also the -Q option.-s src_addr
Uses the following IP address (which must be given as an IP number, not as a host name) as the source address in outgoing probe packets. On hosts with more than one IP address, this option can be used to force the source address to be something other than the IP address of the interface on which the probe packet is sent. If the IP address is not one of this machine's interface addresses, an error is returned and nothing is sent.-v
Lists any received ICMP packets other than TIME_EXCEEDED and UNREACHABLE.-w waittime
Sets the time (in seconds) to wait for a response to a probe. The default is 3 seconds.
host
Specifies the name or IP address of the destination host. This parameter is required.packetsize
Specifies the default length for a probe datagram. This parameter is optional. The default is 38 bytes.
The following examples show how to use the traceroute command.
#1 |
---|
localhost> traceroute nis.nsf.net traceroute to nis.nsf.net (35.1.1.48), 30 hops max, 56 byte packet 1 helios.ee.lbl.gov (128.3.112.1) 19 ms 19 ms 0 ms 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 39 ms 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 39 ms 39 ms 39 ms 6 128.32.197.4 (128.32.197.4) 40 ms 59 ms 59 ms 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 59 ms 8 129.140.70.13 (129.140.70.13) 99 ms 99 ms 80 ms 9 129.140.71.6 (129.140.71.6) 139 ms 239 ms 319 ms 10 129.140.81.7 (129.140.81.7) 220 ms 199 ms 199 ms 11 nic.merit.edu (35.1.1.48) 239 ms 239 ms 239 ms |
This traceroute command displays the route that packets take to a remote host. In this example, note that display lines 2 and 3 are identical. This is due to a bug in the kernel on the second hop system, lbl-csam.arpa , that forwards packets with a zero TTL. (This is a bug in the distributed version of BSD Version 4.3.)
#2 |
---|
localhost> traceroute allspice.lcs.mit.edu traceroute to allspice.lcs.mit.edu (18.26.0.115), 30 hops max 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 19 ms 19 ms 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 19 ms 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 19 ms 39 ms 39 ms 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 20 ms 39 ms 39 ms 6 128.32.197.4 (128.32.197.4) 59 ms 119 ms 39 ms 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 39 ms 8 129.140.70.13 (129.140.70.13) 80 ms 79 ms 99 ms 9 129.140.71.6 (129.140.71.6) 139 ms 139 ms 159 ms 10 129.140.81.7 (129.140.81.7) 199 ms 180 ms 300 ms 11 129.140.72.17 (129.140.72.17) 300 ms 239 ms 239 ms 12 * * * 13 128.121.54.72 (128.121.54.72) 259 ms 499 ms 279 ms 14 * * * 15 * * * 16 * * * 17 * * * 18 ALLSPICE.LCS.MIT.EDU (18.26.0.115) 339 ms 279 ms 279 ms |
In this example, gateways 12, 14, 15, 16, and 17 either do not send ICMP "time exceeded" messages or send them with a TTL too small to reach the local host. Further investigation is required to determine the cause. For example, by contacting the system administrators for gateways 14 through 17, you could discover that these gateways are running the MIT C Gateway code that does not send "time exceeded" messages.
Table B-1 contains some commonly used TCP/IP network management commands and their corresponding Compaq Tru64 UNIX command formats. A UNIX network manager or system manager who is unfamiliar with the TCP/IP Services implementation of TCP/IP might find this information helpful.
Please note that TCP/IP management commands and qualifiers are a subset of the Compaq Tru64 UNIX network commands. Therefore, not all Compaq Tru64 UNIX command options have a corresponding TCP/IP management command. In addition, execution of a UNIX command in a DCL command procedure does not return an error in $STATUS, so you cannot test for the failure of a UNIX command in a DCL command procedure.
TCP/IP Services uses pseudointerfaces to associate more than one IP address with an interface. The TCPIP commands SET INTERFACE and SET NOINTERFACE allow you to add or delete one IP address at a time. Therefore, to add or delete multiple pseudointerfaces, you must enter a SET INTERFACE or SET NOINTERFACE command for each pseudointerface. For information about how to initialize an interface with more than one IP address, refer to the DIGITAL TCP/IP Services for OpenVMS Concepts and Planning and Compaq TCP/IP Services for OpenVMS Management manuals.
The Compaq Tru64 UNIX ifconfig command allows you to associate multiple IP addresses per interface by entering one ifconfig command. Therefore, to create or delete multiple IP addresses in one command, use the ifconfig command.
TCP/IP Command | UNIX Command | Description |
---|---|---|
ARP information | ||
SHOW ARP | netstat -Hn | Displays all ARP entries. 1 |
SHOW ARP | arp -a[-u][-i][-n] | Displays all ARP entries. |
SHOW ARP hostname | arp hostname | Displays entry for a host. 1 |
SET ARP hardware_addr host | arp -s host hardware_addr [ params] | Adds an ARP entry. |
SET NOARP host | arp -d host | Removes an ARP entry. |
Interface information | ||
SHOW INTERFACE |
ifconfig -a[-d][-u][-v]
[-f addr_family] |
Displays information for all interfaces. |
SHOW INTERFACE |
ifconfig -l[-d][-u][-v]
[-f addr_family] |
Displays information for all configured interfaces. |
SHOW INTERFACE /FULL | netstat -i[-n][-d] | Displays information for all configured interfaces. |
SHOW INTERFACE /FULL | netstat -I interface | Displays information on the specified interface. |
netstat -A | Displays miscellaneous information. | |
netstat -I interface -t | Displays timer information for the specified interface. | |
SHOW INTERFACE interface_id [/FULL] | ifconfig interface_id | Displays interface information. |
SET INTERFACE
interface_id
/HOST= host /NETWORK_MASK= mask |
ifconfig interface_id [ address_family] address[/ bitmask] | Sets the primary interface address. |
SET INTERFACE
interface_id
/HOST= host /[NETWORK_MASK= mask] |
ifconfig interface_id [ address_family] alias addr[/ mask] | Adds an alias interface address. |
SET NOINTERFACE interface_id |
ifconfig
interface_id [
address_family]
-alias alias_address |
Removes an alias interface address. |
SET NOINTERFACE
interface_id
/HOST= host [/NETWORK_MASK= mask] 2 |
ifconfig
interface_id [
address_family]
-aliaslist alias_list/ bitmask |
Adds a list of interface aliases. |
SET NOINTERFACE interface_id 3 |
ifconfig
interface_id [
address_family]
-aliaslist alias_list/ bitmask |
Removes a list of interface alias addresses. |
SET INTERFACE interface_id /PARAM= value | ifconfig interface_id param= value | Modifies interface parameters. |
Active sockets information | ||
SHOW DEVICE[/FULL] | netstat -a | Displays the active sockets. |
SHOW DEVICE[/FULL] | netstat -n | Displays the active sockets. |
SHOW DEVICE BG xx[/FULL] | Displays information on a particular socket. | |
Memory information | ||
SHOW COMMUNICATION/MEMORY | netstat -m | Displays memory usage. 1 |
Route information | ||
SHOW ROUTE[/FULL] | netstat -r | Displays all routes. |
SHOW ROUTE host | Displays the route to a destination. | |
SHOW ROUTE/GATEWAY= host | Displays routes. | |
SHOW ROUTE[/FULL] | netstat -r -f address_family | Displays the route for an address family. |
netstat -rs | Displays route statistics. | |
netstat -rv | Displays routes with metrics. | |
SET ROUTE
destination
[/NETWORK] [/MASK= bitmask] /GATEWAY= host |
route add -net|-host destination_address/ bitmask gateway_addr | Adds a route to a host. |
SET NOROUTE destination [/GATEWAY= host] | route delete -net|-host destination_address/ bitmask [ gateway_addr] | Removes a route to a host. |
route [-nqv] change [-net|-host] [ address_family] destination gateway [-link] | Changes route information. | |
Protocol information | ||
SHOW PROTOCOL | netstat -s | Displays statistics for all protocols. 1 |
SHOW PROTOCOL protocol_id | netstat -p protocol_id | Displays protocol statistics for a specific protocol. 1 |
ZERO PROTOCOL protocol_id | netstat -p protocol_id -z | Zeroes protocol statistics. |
sysconfig -s | Shows the configurable subsystems. | |
SHOW PROTOCOL IP/PARAMETERS
SHOW PROTOCOL UDP/PARAMETERS SHOW PROTOCOL TCP/PARAMETERS SHOW PROTOCOL ICMP/PARAMETERS |
sysconfig -q inet [ attribute-list] | Shows the inet subsystem parameters. |
sysconfig -c attr= value ... | Configures subsystems. | |
sysconfig -q subsystem | Shows information about a subsystem. | |
SET PROTOCOL protocol_id /PARAMETERS= value | sysconfig -r inet attr= value ... | Sets protocol attributes. |
sysconfig -r subsyst attr= value ... | Sets other subsystem attributes. | |
NFS information | ||
SET NFS_SERVER
/UID_DEFAULT= value |
sysconfig -r nfs noproxy_uid= value | Specifies the default UID when a user cannot be translated by the proxy. |
SET NFS_SERVER
/GID_DEFAULT= value |
sysconfig -r nfs noproxy_gid= value | Specifies the default GID when a user cannot be translated by the proxy. |
SET NFS_SERVER /THREADS=TCP= value | sysconfig -r nfs tcp_threads= value | Specifies the number of concurrent TCP threads within the NFS server. A value of 0 (zero) will disable the TCP protocol. |
SET NFS_SERVER
/INACTIVITY_TIMER= value |
sysconfig -r nfs vnode_age= value | Specifies the time interval (in seconds) since the last file access request. |
Index | Contents |