4 releases

Uses old Rust 2015

0.1.3 Aug 5, 2022
0.1.2 Aug 9, 2018
0.1.1 Mar 24, 2018
0.1.0 Dec 3, 2017

#621 in Network programming

Download history 188/week @ 2022-08-19 134/week @ 2022-08-26 234/week @ 2022-09-02 272/week @ 2022-09-09 194/week @ 2022-09-16 171/week @ 2022-09-23 361/week @ 2022-09-30 304/week @ 2022-10-07 109/week @ 2022-10-14 177/week @ 2022-10-21 288/week @ 2022-10-28 371/week @ 2022-11-04 396/week @ 2022-11-11 236/week @ 2022-11-18 244/week @ 2022-11-25 129/week @ 2022-12-02

1,051 downloads per month
Used in 5 crates


218 lines


Travis Build Status

TUN/TAP wrapper for Rust.

The TUN/TAP allows implementing a virtual network adapter in userspace. This provides the bindings for Rust.

Create an Iface object and send or recv packets. Making some sense of the packets is, however, out of scope, you need something else for that.

There's documentation and some examples.

Known issues

  • Tested only on Linux. Probably doesn't work anywhere else, but pull requests adding support for other OSes are welcome.
  • The asynchronous interface is very minimal and probably inefficient. It'll need to be extended to allow more flexible or efficient use.


In order to run the tests correctly, a tun10 device with needs to be created first. You can simply run:

sh tests/setup.sh

To remove it:

sh tests/clean.sh

Sudo permission is required.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~18K SLoC