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;
async
- Run the code using
sudo
:
- Set up the device:
- Ping to read packets:
- Analyze the network traffic:
➜ sudo tshark -i <tun-name>
Supported Platforms
- Linux
- FreeBSD
- OpenBSD
- NetBSD
- Android
- OSX
- iOS
- Solaris
- Windows
- QNX
Supported Flags
- Tun
- Tap
- No Packet Info
- Multi-Queue
- Owner
- Group
- MTU
- Persistent