Description
tun-rs is a Rust library for creating and managing TUN and TAP virtual network interfaces. It is for developers building networking software such as VPNs or other tools that need a virtual network device. The library provides synchronous and asynchronous APIs, and its async mode works with the tokio and async-io runtimes. It runs on Windows, Linux, macOS, BSD, iOS, Android and more through one consistent API and packet format. On Linux it supports TSO and GSO hardware offload and multi-queue for using several CPU cores. On macOS it provides a native TAP implementation based on feth pairs, and on Windows it supports DNS configuration. An interface can be given several IPv4 and IPv6 addresses. The README reports up to 70.6 Gbps throughput with concurrent operations and offload features. The project is on GitHub, and its README includes installation instructions and examples.…
Highlights
- TUN and TAP interfaces
- Synchronous and async APIs
- Hardware offload and multi-queue on Linux
- Native TAP on macOS
- Multiple IPv4 and IPv6 addresses per interface
Ratings & Reviews
No ratings yet
Be the first to rate Tun RS.
People also visit
Rustnet
Per-process network monitoring for your terminal with deep packet inspection
Tun RS FAQ
What is tun-rs?
A Rust library for creating and managing TUN and TAP virtual network interfaces.
Who is it for?
Developers building VPNs and other networking software in Rust.
Which platforms are supported?
Windows, Linux, macOS, BSD, iOS, Android and more, through a single API.
Does it support async code?
Yes. It offers both synchronous and asynchronous APIs, with optional tokio or async-io integration.
Can one interface have several IP addresses?
Yes. You can assign multiple IPv4 and IPv6 addresses to a single interface.
What are the best Tun RS alternatives?
Popular alternatives to Tun RS include EcaptureQ, Tunnet and Brook. See all Tun RS alternatives

