On Linux, if you see
mtr: unable to get raw sockets.
The following might help:
sudo chmod 4755 $(which mtr)
The reason this happens is that only privileged processes (or processes with proper capabilities(7)
on Linux) can create raw sockets, which is needed to send/receive ICMP packets. By chmod(2)
, the executable will get the S_ISUID
mode, which means it can set process effective user ID when execve(2)
.
A safer solution is
sudo setcap cap_net_raw+ep $(which mtr)
which only gives mtr
the cap_net_raw
capability.
Reinstalling the mtr
package via the package manager should also solve the problem since it will do whatever appropriate to make it work.