1

I did tracert to google in windows PowerShell and IP addresses of all stations are displayed properly.

However, if I do the same in Linux in a virtual machine to the same server, I see only * * * .

 1  _gateway (10.0.2.2)  5.955 ms  5.568 ms  5.228 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

Why this?

1

The packets that Windows tracert and Linux traceroute use by default are different. Windows tracert sends ICMP packets and Linux traceroute sends UDP packets. The UDP ports are blocked at each hop in your example but ICMP is allowed, so that explains the discrepancy you're seeing.

From Wikipedia: traceroute:

On Unix-like operating systems, traceroute sends, by default, a sequence of User Datagram Protocol (UDP) packets, with destination port numbers ranging from 33434 to 33534; the implementations of traceroute shipped with Linux, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and macOS include an option to use ICMP Echo Request packets (-I), or any arbitrary protocol (-P) such as UDP, TCP using TCP SYN packets, or ICMP.

On Windows, tracert sends ICMP Echo Request packets, rather than the UDP packets traceroute sends by default.

You can have traceroute use ICMP packets in Linux by adding the -I option.

From man traceroute:

traceroute

Print the route packets take to network host.

Syntax
traceroute [options] host [packetsize]

Options:

 -I    Use ICMP ECHO for probes
  • is there a way to force traceroute in linux to also use ICMP? Maybe there is an option ? – infoclogged Mar 7 at 8:39
  • Yes, use traceroute -I – n8te Mar 7 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.