MTR Through Local Proxy Limitations | Generated by AI

Home 2026.04

Question: Can we run MTR through a local proxy like Mihomo or Clash on port 7890 etc.?

Answer:

Short Answer

No, not directly and not reliably.

MTR (and the underlying traceroute + ping tools it uses) operates at a low network level using ICMP (for ping) and UDP or ICMP (for traceroute). Most local proxies like Clash, Mihomo, or similar tools primarily handle TCP (and sometimes UDP) traffic through SOCKS5 or HTTP proxies. They do not natively support or forward raw ICMP packets in a way that standard command-line tools like mtr can use.

Why It Usually Doesn’t Work

Possible Workarounds (Limited Success)

Here are the realistic options, ranked from easiest to most complex:

  1. Use TUN Mode in Mihomo/Clash (Best for most users)
    Enable TUN mode (virtual network interface) in your Clash/Mihomo client.
    This intercepts all traffic at the system level, including ICMP in many cases.
    • Then run normal mtr google.com.
    • Result: MTR traffic goes through the selected proxy node (if your rules allow it).
    • Limitation: ICMP support in TUN mode varies by platform (better on Linux/macOS with proper setup; Windows is trickier). DNS resolution may also be affected if fake-IP is enabled.
  2. Set Rules to DIRECT for MTR
    In Mihomo/Clash config, add a rule so MTR’s traffic bypasses the proxy:
    • By process name: PROCESS-NAME,mtr,DIRECT
    • Or by destination: specific domains/IPs set to DIRECT.
      This lets you run MTR normally without proxy interference, but it does not route MTR through the proxy.
  3. Use Proxy-Aware Alternatives
    • tcptraceroute or traceroute -T (TCP-based traceroute) — these can sometimes work better with SOCKS5 if you wrap them with proxychains or tsocks.
    • proxychains-ng (or proxychains4):
      Install it, configure with your local SOCKS5 port (e.g., 7890), then run:
      proxychains mtr google.com
      Success rate: Low for ICMP-based MTR, better for TCP variants.
    • hping3 or custom scripts for ICMP over TCP tunnels (advanced, not recommended for daily use).
  4. Run MTR on a Remote Server
    SSH into a VPS that routes through your desired proxy/VPN, then run MTR there. This is often the cleanest way to test routing through a specific proxy path.

  5. Advanced Setup (Linux only)
    Use redir/iptables + socat or tools like iproxy to forward ICMP, but this is fragile and not worth it for most people.

Recommendation

In practice, most network engineers run MTR without the local proxy active when they want accurate hop-by-hop information, or they use it in TUN mode for a “proxied view”.

If you tell me your operating system (Linux, macOS, Windows) and exact Mihomo/Clash setup (TUN enabled? mixed-port or SOCKS-only?), I can give more precise commands.

References:


Back Donate