traceroute shows just * * * in linux ( in a virtual machine ), although displays all IPs in windows correctly

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?

infoclogged

Posted 2019-03-07T08:18:39.347

Reputation: 243

Answers

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

n8te

Posted 2019-03-07T08:18:39.347

Reputation: 6 068

is there a way to force traceroute in linux to also use ICMP? Maybe there is an option ? – infoclogged – 2019-03-07T08:39:32.437

Yes, use traceroute -I – n8te – 2019-03-07T08:40:29.840