Scroll to navigation

TUNCTL(8) TUNCTL(8)

NAME

tunctl - create and manage persistent TUN/TAP interfaces

SYNOPSIS

tunctl [ OPTIONS ] [ -u owner ] [ -t device-name ]

tunctl -d device-name

DESCRIPTION

tunctl allows the host sysadmin to preconfigure a TUN/TAP network interface for use by a particular user. That user may open and use the network/write side of the interface, but may not change any aspects of the host side of the interface.

OPTIONS

Brief output, prints just the interface name
Create a point-to-point TUN interface without Ethernet header. Automatically enabled if the desired interface name starts with "tun".
Create a TAP type interface with Ethernet header. Automatically selected if the desired interface starts with "tap" or if no interface name is given.
Specifies the tun clone device name. The default is /dev/net/tun, but some systems use /dev/misc/net/tun instead.
Delete the specified interfacename (set it to non-persistent)
Specifies the owner of the interface. This user is allowed to attach to the "network/wire" side.
Specifies the group of the interface. This group is allowed to attach to the "network/wire" side of the interface.
Specifies the desired interface name.

USAGE

To create an interface for use by a particular user, invoke tunctl without the -d option:


# tunctl -u someuser
Set 'tap0' persistent and owned by 'someuser'

Then, configure the interface as normal:


# ifconfig tap0 192.168.0.254 up
# route add -host 192.168.0.253 dev tap0
# bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
# arp -Ds 192.168.0.253 eth0 pub

To delete the interface, use the -d option:


# tunctl -d tap0
Set 'tap0' nonpersistent

SEE ALSO

The UserModeLinux-HOWTO <URL:http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO.html>

AUTHOR

tunctl was originally written by Jeff Dike <jdike@karaya.com> as part of the User Mode Linux tools. Current version is maintained as a separate package by Henrik Nordstrom <henrik@henriknordstrom.net>.

This manual page was originally written by Matt Zimmerman <mdz@debian.org> for the Debian GNU/Linux system, based on examples from Jeff Dike. Extended by Henrik Nordstrom <henrik@henriknordstrom.net> to cover all options supported.

26 February 2024