Linux Traceroute and Linux Tracert
2014-04
Im with a problem with traceroute on linux, the command traceroute its not working but tracert is working but both commands run the traceroute command, tracert is just a symbolic link to traceroute strangely just tracert work.
Attached is the image.
Somebody can help?
The program is looking at argv[0]
(it's name) and involving different behavior based on which command tracert
or traceroute
you're using.
if you execute the program tracert then argv[0] is tracert.
So two commands, same executable, different paths through the code invoking different behavior.
On Ubuntu Linux:
traceroute6 is equivalent to traceroute -6
tracert is equivalent to traceroute -I
tcptraceroute is equivalent to traceroute -T
I was reading the manpage for traceroute
, and I noticed it accepts a port
argument.
I thought traceroute
worked only with ICMP. What does it do with the port?
Traceroute (classical mode) works by sending UDP packets to a high, theoretically unused UDP port, changing the time to live (TTL) for each packet so that routers along the way notice that it has timed out and return ICMP time exceeded messages. Traceroute then prints those messages out until it gets a message from the destination host denying the connection.
You can change the port in case the default port is in use (thus preventing that last hop from working because the packet is silently accepted).
There is a wealth of information in the man page for traceroute on your standard Linux distro.
That's in case ICMP is blocked somewhere along the way.
You could for example use port 80 (http) because almost any firewall will allow it to pass through.