Linux Traceroute and Linux Tracert

3

1

I'm having a problem with traceroute on Linux. The command isn't working but tracert does work fine. Both commands are actually running the traceroute command as tracert is just a symbolic link to traceroute.

Why is it not working as expected?

Here's a screenshot showing the behavior:

traceroute not working, just tracert

justcode

Posted 2013-08-29T23:16:34.963

Reputation: 183

2There may be other programs in your shell's search path with one or both names. Try ./tracert, ./traceroute (to invoke the executables in your current location) and which tracert and which traceroute to see what is actually run when you don't specify the location. – IMSoP – 2013-08-29T23:34:42.450

Answers

6

The program is looking at argv[0] (its name) and invoking 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

dcaswell

Posted 2013-08-29T23:16:34.963

Reputation: 176

Certainly a possibility, though it would be interesting to know which options are being flipped to explain the particular difference in behaviour. – IMSoP – 2013-08-29T23:35:53.160

Good idea to add that info -- done! – dcaswell – 2013-08-29T23:50:34.797

Fixed, same as traceroute -I. – justcode – 2013-08-30T01:06:01.733

1

Add traceroute to your system PATH:

$echo $PATH
xxxxxxxx

$ which traceroute
/bin/traceroute

does xxxxxxxx contains traceroute? Then just make a soft link.

jason

Posted 2013-08-29T23:16:34.963

Reputation: 11