traceroute [-46dFITUnreAV] [-f first_ttl] [-g gate,...]
[-i device] [-m max_ttl] [-p port] [-s src_addr]
[-q nqueries] [-N squeries] [-t tos]
[-l flow_label] [-w waittime] [-z sendwait]
[-UL] [-P proto] [--sport=port] [-M method] [-O mod_options]
tracks the route packets taken from an IP network on their
way to a given host. It utilizes the IP protocol’s time to live (TTL) field
and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway
along the path to the host.
is equivalent to
The only required parameter is the name or IP address of the
is the total size of the probing packet (default 60 bytes
for IPv4 and 80 for IPv6). The specified size can be ignored
in some situations or increased up to a minimal value.
This program attempts to trace the route an IP packet would follow to some
internet host by launching probe
packets with a small ttl (time to live) then listening for an
ICMP "time exceeded" reply from a gateway. We start our probes
with a ttl of one and increase by one until we get an ICMP "port
unreachable" (or TCP reset), which means we got to the "host", or hit a max (which
defaults to 30 hops). Three probes (by default) are sent at each ttl setting
and a line is printed showing the ttl, address of the gateway and
round trip time of each probe. The address can be followed by additional
information when requested. If the probe answers come from
different gateways, the address of each responding system will
be printed. If there is no response within a 5.0 seconds (default),
an "*" (asterisk) is printed for that probe.
After the trip time, some additional annotation can be printed:
(host, network or protocol unreachable),
(source route failed),
(communication administratively prohibited),
(host precedence violation),
(precedence cutoff in effect), or
(ICMP unreachable code <num>).
If almost all the probes result in some kind of unreachable, traceroute
will give up and exit.
We don’t want the destination host to process the UDP probe packets,
so the destination port is set to an unlikely value (you can change it with the
flag). There is no such a problem for ICMP or TCP tracerouting (for TCP we
use half-open technique, which prevents our probes to be seen by applications
on the destination host).
In the modern network environment the traditional traceroute methods
can not be always applicable, because of widespread use of firewalls.
Such firewalls filter the "unlikely" UDP ports, or even ICMP echoes.
To solve this, some additional tracerouting methods are implemented
(including tcp), see
LIST OF AVAILABLE METHODS
will use IPv4.
Varying the size of the probing packet by the
command line parameter, you can manually obtain information
about the MTU of individual network hops. The
option (see below) tries to do this automatically.
Note, that non-fragmented features (like
work properly since the Linux kernel 2.6.22 only.
Before that version, IPv6 was always fragmented, IPv4 could use
the once the discovered final mtu only (from the route cache), which can be
less than the actual mtu of a device.
(most routers have disabled source routing for security reasons).
In general, several
is allowed (comma separated). For IPv6, the form of
is allowed, where
is a route header type (default is type 2). Note the type 0 route header
is now deprecated (rfc5095).
should send packets. By default, the interface is selected
according to the routing table.
will probe. The default is 30.
considerably. The default value is 16.
Note that some routers and hosts can use ICMP rate throttling. In such
a situation specifying too large number can lead to loss of some responses.
will use (the destination port number will be incremented by each probe).
For ICMP tracing, specifies the initial icmp sequence value (incremented
by each probe too).
For TCP specifies just the (constant) destination
port to connect.
For IPv6, set the Traffic Control value.
followed by a hexadecimal dump.
The MPLS (rfc4950) is shown parsed, in a form:
(more objects separated by
There is a couple of additional options, intended for an advanced usage
(another trace methods etc.):
Normally source ports (if applicable) are chosen by the system.
Method-specific options can be passed by
Most methods have their simple shortcuts,
(-I means -M icmp,
Each method may have its own specific options, or many not have them at all.
To print information about available options, use
is printed once in a form of
at the first probe of a hop which requires such
to be reached. (Actually, the correspond "frag needed" icmp message
normally is sent by the previous hop).
Note, that some routers might cache once the seen information
on a fragmentation. Thus you can receive the final mtu from a closer hop.
Try to specify an unusual
, this can help for one attempt (then it can be cached there as well).
option for more info.
In general, a particular traceroute method may have to be chosen by
The traditional, ancient method of tracerouting. Used by default.
Probe packets are udp datagrams with so-called "unlikely" destination ports.
The "unlikely" port of the first probe is 33434, then for each next probe
it is incremented by one. Since the ports are expected to be unused,
the destination host normally returns "icmp unreach port" as a final response.
(Nobody knows what happens when some application listens for such ports,
Most usual method for now, which uses icmp echo packets for probes.
If you can ping(8) the destination host, icmp tracerouting is applicable
Well-known modern method, intended to bypass firewalls.
Uses the constant destination port (default is 80, http).
If some filters are present in the network path, then most probably
any "unlikely" udp ports (as for
method) or even icmp echoes (as for
are filtered, and whole tracerouting will just stop at such a firewall.
To bypass a network filter, we have to use only allowed protocol/port
combinations. If we trace for some, say, mailserver, then more likely
-T -p 25
can reach it, even when
This method uses well-known "half-open technique", which prevents
applications on the destination host from seeing our probes at all.
Normally, a tcp syn is sent. For non-listened ports we receive tcp reset,
and all is done. For active listening ports we receive tcp syn+ack, but
answer by tcp reset (instead of expected tcp ack), this way the remote tcp
session is dropped even without the application ever taking notice.
There is a couple of options for
setting for the tcp header options above and
Always set by default, if nothing else specified.
for maxseg tcp header option (when
Default options is
An initial implementation of tcp method, simple using connect(2) call,
which does full tcp session opening. Not recommended for normal use, because
a destination application is always affected (and can be confused).
Use udp datagram with constant destination port (default 53, dns).
Intended to bypass firewall as well.
Note, that unlike in
method, the correspond application on the destination host
receive our probes (with random data), and most can easily be confused
by them. Most cases it will not respond to our packets though, so we will never
see the final hop in the trace. (Fortunately, it seems that at least
dns servers replies with something angry).
Use udplite datagram for probes (with constant destination port,
This method is allowed for unprivileged users.
Send raw packet of protocol
No protocol-specific headers are used, just IP header only.
To speed up work, normally several probes are sent simultaneously.
On the other hand, it creates a "storm of packages", especially
in the reply direction. Routers can throttle the rate of icmp responses,
and some of replies can be lost. To avoid this, decrease the number
of simultaneous probes, or even set it to 1 (like in initial traceroute
The final (target) host can drop some of the simultaneous probes,
and might even answer only the latest ones. It can lead to extra
"looks like expired" hops near the final hop. We use a smart algorithm
to auto-detect such a situation, but if it cannot help in your case, just use
For even greater stability you can slow down the program’s work by
option, for example use
for half-second pause between probes.
If some hops report nothing for every method, the last chance to obtain
something is to use