Async TUN/TAP
Asynchronous allocation of TUN/TAP devices in Rust using async-std
.
Getting Started
- Create a tun device using
TunBuilder
and read from it in a loop:
use AsRawFd;
use *;
use task;
use Result;
use TunBuilder;
use Ipv4Addr;
async
- Run the code using
sudo
:
- Set the address of device:
- Ping to read packets:
- Display devices and analyze the network traffic:
➜ ip tuntap
➜ sudo tshark -i <tun-name>
Supported Platforms
- Linux (without Multi-Queue)
- FreeBSD
- OpenBSD
- NetBSD
- Android
- OSX
- iOS
- Solaris
- Windows
- QNX