tunctl — TUN/TAP Device Control Utility
What is tunctl?
tunctl?tunctl is a userspace utility from the uml-utilities package that allows administrators to create and delete TUN/TAP network interfaces. These interfaces are commonly used in virtual networking, VPNs, and User Mode Linux (UML) setups.
TUN = Network layer device (IP packets)
TAP = Data link layer device (Ethernet frames)
Typical Use Cases
Virtual Machine Networking
Bridge TAP interfaces to VMs for layer-2 traffic
VPN Software
Create secure point-to-point tunnels
Network Emulation
Used in labs and testbeds for simulating networks
Container Networking
Lightweight setup for L2/L3 interfaces
Key Commands
1. Create a TAP Interface
sudo tunctl -t tap0Creates a TAP device named tap0.
2. Create TAP Device with Owner
Assigns ownership of the device to username so that unprivileged users can access it.
3. Delete TAP Interface
Removes the tap0 device.
After Creation: Bring Interface Up
Or use with a bridge:
Alternatives to tunctl
tunctlip tuntap
Modern equivalent via iproute2. Replaces tunctl.
openvpn
Manages tun/tap internally for VPNs.
bridge-utils
Works in combination with tap interfaces.
Example with ip tuntap:
ip tuntap:Dependency
tunctl is part of the uml-utilities package:
Summary
Role
Create/delete TUN/TAP interfaces
Scope
Virtual networking (L2/L3)
Replacement
ip tuntap (recommended modern alternative)
Common Use Cases
VMs, VPNs, emulated networks
Last updated