Your company here, and a link to your site. Click to find out more.

tunctl - Man Page

create and manage persistent TUN/TAP interfaces


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

tunctl -d device-name


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.



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.

-f tun-clone-device

Specifies the tun clone device name. The default is /dev/net/tun, but some systems use /dev/misc/net/tun instead.

-d interfacename

Delete the specified interfacename (set it to non-persistent)

-u user

Specifies the owner of the interface. This user is allowed to attach to the "network/wire" side.

-g group

Specifies the group of the interface. This group is allowed to attach to the "network/wire" side of the interface.

-t interface

Specifies the desired interface name.


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 up

        # route add -host dev tap0

        # bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'

        # arp -Ds 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>


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.

Referenced By


July 9, 2008