| Crates.io | ftr |
| lib.rs | ftr |
| version | 0.6.0 |
| created_at | 2025-06-02 23:17:17.011081+00 |
| updated_at | 2025-08-29 19:41:00.757617+00 |
| description | A fast, parallel ICMP traceroute with ASN lookup, reverse DNS, and ISP detection |
| homepage | https://github.com/dweekly/ftr |
| repository | https://github.com/dweekly/ftr |
| max_upload_size | |
| id | 1698458 |
| size | 861,496 |
A fast, parallel traceroute implementation with automatic ASN lookup. Available as both a command-line tool and a Rust library.
# Basic usage
ftr google.com
# With custom options
ftr --json --max-hops 20 google.com
use ftr::{Ftr, TracerouteConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create an Ftr instance
let ftr = Ftr::new();
// Simple trace
let result = ftr.trace("google.com").await?;
println!("Found {} hops", result.hop_count());
// Custom configuration
let config = TracerouteConfig::builder()
.target("1.1.1.1")
.max_hops(20)
.build()?;
let result = ftr.trace_with_config(config).await?;
Ok(())
}
See docs/LIBRARY_USAGE.md for comprehensive library documentation.
Option 1: Download Pre-built Binary (when available)
Option 2: Build from Source
git clone https://github.com/dweekly/ftr
cd ftr
cargo build --release
# The binary will be at target/release/ftr.exe
Timeout Recommendations:
ftr --no-enrich --no-rdns targetExample:
# Reliable with enrichment
ftr --probe-timeout-ms 100 google.com
# For shorter timeouts, disable enrichment
ftr --probe-timeout-ms 30 --no-enrich --no-rdns google.com
For technical details about Windows async implementation, see docs/WINDOWS_ASYNC_FINDINGS.md.
brew tap dweekly/ftr && brew install ftr
If you are on a Debian-based Linux distribution (like Ubuntu, Debian, Mint, etc.), you can install ftr using our APT repository for easy installation and updates.
sudo apt-get update
sudo apt-get install -y curl gpg ca-certificates
# Create the directory for GPG keys if it doesn't exist
sudo mkdir -p /usr/share/keyrings
# Download and save the GPG key
sudo curl -sSL https://apt.networkweather.com/networkweather.noarmor.gpg -o /usr/share/keyrings/networkweather-archive-keyring.gpg
# Automatically detect your system architecture and add the appropriate repository
ARCH=$(dpkg --print-architecture)
echo "deb [signed-by=/usr/share/keyrings/networkweather-archive-keyring.gpg arch=$ARCH] https://apt.networkweather.com stable main" | sudo tee /etc/apt/sources.list.d/networkweather.list
sudo apt-get update
sudo apt-get install ftr
Once installed, ftr will be updated along with your other system packages when you run sudo apt-get upgrade.
Alternatively, you can download the .deb package directly from the latest release:
# For x86_64/amd64
wget https://github.com/dweekly/ftr/releases/latest/download/ftr_<version>_amd64.deb
sudo dpkg -i ftr_<version>_amd64.deb
# For ARM64/aarch64
wget https://github.com/dweekly/ftr/releases/latest/download/ftr_<version>_arm64.deb
sudo dpkg -i ftr_<version>_arm64.deb
# Install from FreeBSD ports (when available)
pkg install ftr
Build Dependencies:
# Required for building
pkg install -y rust openssl perl5 pkgconf
# Required for runtime functionality
pkg install -y ca_root_nss
Build and Install:
# Clone and build
git clone https://github.com/dweekly/ftr
cd ftr
cargo build --release
# Install the binary
sudo cp target/release/ftr /usr/local/bin/
Important Notes:
ca_root_nss package is required for HTTPS connections (public IP detection and ASN lookups)ca_root_nss, you'll see "Warning: Failed to detect public IP"Usage on FreeBSD:
# Must run as root
sudo ftr google.com
# Or make the binary setuid root
sudo chown root:wheel /usr/local/bin/ftr
sudo chmod u+s /usr/local/bin/ftr
# Then run normally
ftr google.com
# Install from OpenBSD ports (when available)
pkg_add ftr
Build Dependencies:
# Required for building
pkg_add rust git
# Optional but recommended
pkg_add rsync jq
Build and Install:
# Clone and build
git clone https://github.com/dweekly/ftr
cd ftr
cargo build --release
# Install the binary
doas cp target/release/ftr /usr/local/bin/
Important Notes:
Usage on OpenBSD:
# Must run as root
doas ftr google.com
# Or make the binary setuid root
doas chown root:wheel /usr/local/bin/ftr
doas chmod u+s /usr/local/bin/ftr
# Then run normally
ftr google.com
cargo install ftr
Note: Cargo installation will be available once ftr is published to crates.io.
Basic usage:
ftr google.com
With options:
ftr example.com -m 20 -W 5000
-s, --start-ttl <START_TTL> - Starting TTL value (default: 1)-m, --max-hops <MAX_HOPS> - Maximum number of hops (default: 30)--probe-timeout-ms <MS> - Timeout for individual probes in milliseconds (default: 1000)-i, --send-launch-interval-ms <MS> - Interval between launching probes (default: 5)-W, --overall-timeout-ms <MS> - Overall timeout for the traceroute (default: 3000)--no-enrich - Disable ASN lookup and segment classification--no-rdns - Disable reverse DNS lookupsftr to google.com (142.251.46.174), 30 max hops, 1000ms probe timeout, 3000ms overall timeout
Performing ASN lookups, reverse DNS lookups and classifying segments...
1 [LAN ] unifi.localdomain (192.168.1.1) [Private Network] 2.854 ms
2 [ISP ] lo0.bras2.rdcyca01.sonic.net (157.131.132.109) [AS46375 - AS-SONICTELECOM, US] 3.861 ms
3 [ISP ] 135-180-179-42.dsl.dynamic.sonic.net (135.180.179.42) [AS46375 - AS-SONICTELECOM, US] 6.342 ms
4 [ISP ] ae8.cr2.lsatca11.sonic.net (142.254.59.217) [AS46375 - AS-SONICTELECOM, US] 16.705 ms
5 [ISP ] ae2.cr1.lsatca11.sonic.net (157.131.209.161) [AS46375 - AS-SONICTELECOM, US] 12.469 ms
6 [TRANSIT] be3402.ccr31.sjc04.atlas.cogentco.com (154.54.80.241) [AS174 - COGENT-174, US] 3.904 ms
7 [TRANSIT] be3142.ccr41.sjc03.atlas.cogentco.com (154.54.42.89) [AS174 - COGENT-174, US] 3.989 ms
8 [TRANSIT] tata.sjc03.atlas.cogentco.com (154.54.13.62) [AS174 - COGENT-174, US] 3.177 ms
9 [DESTINATION] 72.14.195.206 [AS15169 - GOOGLE, US] 6.174 ms
10 [DESTINATION] 108.170.252.33 [AS15169 - GOOGLE, US] 5.316 ms
11 [DESTINATION] 142.250.49.206 [AS15169 - GOOGLE, US] 4.892 ms
12 [DESTINATION] sfo07s16-in-f14.1e100.net (142.251.46.174) [AS15169 - GOOGLE, US] 3.275 ms
Detected ISP from public IP 192.184.165.158: AS46375 (AS-SONICTELECOM, US)
Privilege requirements vary by mode and platform:
IP_RECVERR)On Linux, you can enable DGRAM ICMP for non-root users:
sudo sysctl -w net.ipv4.ping_group_range="0 65535"
pkg install -y rust openssl perl5 pkgconf rsyncpkg_add rustgit clone https://github.com/dweekly/ftr
cd ftr
# Install git hooks (IMPORTANT: prevents issues caught by CI)
./.githooks/install-hooks.sh
# OR configure git to use .githooks directory:
# git config core.hooksPath .githooks
cargo build --release
# Binary will be at: target/release/ftr
This traceroute implementation:
Unlike traditional sequential traceroute implementations, this tool sends multiple probes in parallel, dramatically reducing the time needed to map a complete network path.
Typical performance improvements over traditional traceroute:
The parallel approach maintains accuracy while significantly reducing wait time.
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
David Weekly (dweekly)
When enrichment is enabled (default), segments are shown as:
LAN: local/private addressesISP: your provider’s network (includes CGNAT range)TRANSIT: networks after ISP with different ASNs than the destinationDESTINATION: networks in the destination’s ASNUNKNOWN: insufficient data to classifyThe JSON output’s segment field also reflects these refined labels when available.