https://github.com/shellrow/tracert
Cross-platform library for traceroute and ping. Written in Rust.
https://github.com/shellrow/tracert
Last synced: 3 months ago
JSON representation
Cross-platform library for traceroute and ping. Written in Rust.
- Host: GitHub
- URL: https://github.com/shellrow/tracert
- Owner: shellrow
- License: mit
- Created: 2022-04-24T14:12:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T12:57:23.000Z (about 2 years ago)
- Last Synced: 2025-04-08T05:24:44.484Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 132 KB
- Stars: 18
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[crates-badge]: https://img.shields.io/crates/v/tracert.svg
[crates-url]: https://crates.io/crates/tracert
[license-badge]: https://img.shields.io/crates/l/tracert.svg
[tracert-url]: https://github.com/shellrow/tracert
# tracert [![Crates.io][crates-badge]][crates-url] ![License][license-badge]
Cross-platform library for traceroute and ping.
tokio-based asynchronous probing is supported for all features.
## Features
- traceroute
- [x] IPv4 ICMP
- [x] IPv6 ICMP
- [x] IPv4 UDP
- [x] IPv6 UDP
- ping
- [x] IPv4 ICMPv4
- [x] IPv6 ICMPv6
- [x] IPv4 UDP
- [x] IPv6 UDP
- [x] IPv4 TCP
- [x] IPv6 TCP
## Usage
Add `tracert` to your dependencies
```
[dependencies]
tracert = "0.12"
```
## 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.