28 releases (17 breaking)

Uses new Rust 2024

0.40.0 Dec 20, 2025
0.39.0 Nov 8, 2025
0.38.2 Oct 12, 2025
0.36.0 Jun 29, 2025
0.24.0 Feb 25, 2024

#81 in Network programming

Download history 16081/week @ 2025-09-17 18866/week @ 2025-09-24 21377/week @ 2025-10-01 22329/week @ 2025-10-08 23338/week @ 2025-10-15 20849/week @ 2025-10-22 21106/week @ 2025-10-29 23328/week @ 2025-11-05 22337/week @ 2025-11-12 22971/week @ 2025-11-19 20093/week @ 2025-11-26 25276/week @ 2025-12-03 25254/week @ 2025-12-10 21868/week @ 2025-12-17 11669/week @ 2025-12-24 13802/week @ 2025-12-31

77,812 downloads per month
Used in 226 crates (33 directly)

MIT license

215KB
5K SLoC

netdev Crates.io License

netdev provides a cross-platform API for network interface.

Key Features

  • Enumerate all available network interfaces
  • Detect the default network interface
  • Retrieve interface metadata:
    • Interface type
    • MAC address
    • IPv4 / IPv6 addresses and prefixes
    • MTU, flags, operational state, etc...
  • Native traffic statistics (RX/TX bytes) for each interface
  • Designed for cross-platform

See the Interface struct documentation for detail.

Supported platform

  • Linux
  • macOS
  • Windows
  • Android
  • iOS (and other Apple targets)
  • BSDs

Usage

Add netdev to your Cargo.toml

[dependencies]
netdev = "0.40"

For more details, see examples or doc.

Project History

This crate was originally published as default-net and later rebranded to netdev by the author myself for future expansion, clearer naming, and long-term maintenance.

Tested on

  • Linux
    • Ubuntu
      • 24.04
      • 22.04
      • 21.10
      • 20.04
      • 18.04
    • Kali
      • 2024.2
      • 2023.2
      • 2022.1
      • 2021.1
    • Arch
      • 2024.05.01
  • macOS (Apple Silicon)
    • 14.7.6
  • macOS (Intel)
    • 13.4.1
    • 11.6
  • Windows
    • 11 24H2 26100.6584
    • 11 23H2 22631.4602
    • 11 Pro 22H2 22621.3155
    • 11 22H2 22621.3155
    • 10 21H2 19044.1586
  • FreeBSD
    • 14
  • Android (arm64)
    • 16.0
  • Android (x86_64)
    • 16.0
  • iOS
    • 18.6.2
    • 18.1.1

Dependencies

~0.1–14MB
~125K SLoC