Registry / networking / tun
library0.8.9rscratesunverified

Provides creation and handling of TUN/TAP virtual network devices.

# Cargo.toml [dependencies] tun = "0.8.9"
INSTALL
IMPORT
SIG · TUN
T
tun
networkingrustv0.8.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tun
✓ use tun::Tun;

Creates a TUN virtual network interface.

use tun::Tun; fn main() -> Result<(), Box<dyn std::error::Error>> { let mut config = tun::Configuration::default(); config.name("tun0").up(); let tun = Tun::create(&config)?; println!("TUN device created: {:?}", tun); Ok(()) }
Debug
Known issues
gotchaRequires root or CAP_NET_ADMIN capability on Linux to create TUN devices.
fix
Run the binary with sudo or grant the CAP_NET_ADMIN capability.
affects: >=0.8.0
Upgrade
Version history
0.8.9latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
tun — cargo add tun · libregistry