26

On recent Linux based operating systems there is no ifconfig and traceroute. Some functionality has been incorporated into the ip utility (see here for examples), but I have not found a replacement for the traceroute command.

I know that I can do yum install net-tools or yum install traceroute when I am on CentOS or RHEL but our servers come preinstalled without that command and while we are allowed to sudo certain commands installing additional software is always a problem

3
  • You have to negotiate a baseline/template with a bare minimum of mandatory commands to be able to do your work. You are trying to solve a political problem with a technical workaround. Escalate this need to your superior(s). Feb 15, 2019 at 8:52
  • 1
    @RuiFRibeiro I agree, but only 99% ;-) ifconfig for example is outdated and can be replaced by ip addr show. My hope was that there is also a "new-style" command that jumps in for traceroute
    – Marged
    Feb 15, 2019 at 9:05
  • 2
    tracepath and mtr are available by default in Ubuntu 20.04
    – Wolf
    Sep 10, 2020 at 14:14

4 Answers 4

50

Try if command "tracepath" available

1
  • available in Linux Mint 21 Feb 22, 2023 at 14:56
20

The utility mtr (aka Mike's traceroute, aka Matt's traceroute) has been described as "traceroute on steroids", and gets favorable reviews here, here and in this SE Q&A. It seems to have been around for a while.

I use mtr on macOS occasionally to evaluate DNS options, and it seems to work very well. I got my copy through MacPorts. It comes pre-installed on at least some Linux distros (e.g. Ubuntu 20.04). It's also available through its GitHub site.

Finally, there's a How-To guide for using mtr.

1
  • available by default in Linux Mint 21 Feb 22, 2023 at 14:56
5

While traceroute is no longer available in recent Linux distro, traceroute6 is still available but only for IPv6.

wolf@linux:~$ whatis traceroute6
traceroute6 (8)      - traces path to a network host
wolf@linux:~$ 

If you want to run it against IPv4, use tracepath or mtr.

You don't have to install or compile it separately as it's already there in the OS.

wolf@linux:~$ whatis tracepath 
tracepath (8)        - traces path to a network host discovering MTU along this path
wolf@linux:~$ 
wolf@linux:~$ whatis mtr
mtr (8)              - a network diagnostic tool
wolf@linux:~$ 
2

It strongly depends on your configuration. I've got two options for you:

  1. Compile traceroute by yourself. Use compiled binary without any problem.
  2. If there is busybox package installed on your system, then you can simply use it's binary as traceroute. Just link busybox binary as traceroute (in case of my system it is ln -s /bin/busybox traceroute), and then use this link to act as traceroute: ./traceroute google.com.
1
  • 3
    Any admin worth his salt, if doing a minimum bare install, wont install development tools in a minimum vm nowadays. Long are gone the days vmtools had to be compiled in. If I do not need backup and Nagios agents, I can supply a barebones Debian VM around 200MB for a DNS/DHCP server (not trying to diminish the merit of the answer) Feb 15, 2019 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .