tunctl man page

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

-b
Brief output, prints just the interface name
-n
Create a point-to-point TUN interface without Ethernet header. Automatically enabled if the desired interface name starts with "tun".
-p
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.

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/…>

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.

Referenced By

edge(8).

July 9, 2008