14 releases (breaking)

new 0.10.0 Feb 14, 2026
0.9.0 Apr 27, 2025
0.8.0 May 19, 2024
0.7.0 Aug 17, 2023
0.3.1 May 7, 2022

#7 in #traceroute

MIT license

52KB
1.5K SLoC

tracert Crates.io License

Cross-platform library for traceroute and ping. Written in Rust. tokio-based asynchronous probing is supported for all features.

Features

  • traceroute
    • IPv4 ICMP
    • IPv6 ICMP
    • IPv4 UDP
    • IPv6 UDP
  • ping
    • IPv4 ICMPv4
    • IPv6 ICMPv6
    • IPv4 UDP
    • IPv6 UDP
    • IPv4 TCP
    • IPv6 TCP

Usage

Add tracert to your dependencies

[dependencies]
tracert = "0.10"

Examples

  • examples/icmp_ping.rs
  • examples/icmp_trace.rs
  • examples/tcp_ping.rs
  • examples/udp_ping.rs
  • examples/udp_trace.rs
  • examples/parallel_trace.rs

Note for Windows users

You may need to set up firewall rules that allow ICMP Time-to-live Exceeded and ICMP Destination (Port) Unreachable packets to be received.

netsh example

netsh advfirewall firewall add rule name="All ICMP v4" dir=in action=allow protocol=icmpv4:any,any
netsh advfirewall firewall add rule name="All ICMP v6" dir=in action=allow protocol=icmpv6:any,any

Additional Notes

This library may require the ability to create raw sockets depending on the operating system.

  • Linux: root privileges or CAP_NET_RAW capability are typically required.
  • macOS / Windows: Administrator privileges are usually not required for standard traceroute operations.

If you encounter permission errors, try running with elevated privileges.

Dependencies

~5–20MB
~219K SLoC