Traceroute vs tracert
I'm having the following issue:
Running tracert
from Windows 7 returns all the hops to a given server.
Running traceroute
from Fedora 30, using the same connection and the same destination, beyond the gateway IP it returns only * * *.
Could you please explain me why from Windows it is working, but from Fedora is not? What is the difference?
Also, can you advise me how can I make traceroute
return hops when being ran from Fedora?
Solution 1:
Windows' tracert
is using ICMP while incrementing TTL to do probes:
How to Use the TRACERT Utility
The TRACERT diagnostic utility determines the route to a destination by sending Internet Control Message Protocol (ICMP) echo packets to the destination.
Fedora's traceroute
, by default, sends UDP probes, as have been previous Unix traceroute implementations doing. The hint UDP is default (beside having double-checked by doing a capture before writing this answer) is from man which talks first about UDP:
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 -p 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).
Both tools expect to receive ICMP TIME EXCEEDED as response to build the route.
Along this path, various routers may choose to answer differently (ie: not at all) depending on the probe method used.
If you know that ICMP probes work better for your test, you can do the same on Fedora with:
traceroute --icmp destination
As ICMP, contrary to UDP, usually requires crafting special packets, the command might require root privileges to run with this option.