1TUNCTL(8) TUNCTL(8)
2
3
4
6 tunctl - create and manage persistent TUN/TAP interfaces
7
9 tunctl [ OPTIONS ] [ -u owner ] [ -t device-name ]
10
11 tunctl -d device-name
12
14 tunctl allows the host sysadmin to preconfigure a TUN/TAP network
15 interface for use by a particular user. That user may open and use the
16 network/write side of the interface, but may not change any aspects of
17 the host side of the interface.
18
20 -b Brief output, prints just the interface name
21
22 -n Create a point-to-point TUN interface without Ethernet header.
23 Automatically enabled if the desired interface name starts with
24 "tun".
25
26 -p Create a TAP type interface with Ethernet header. Automatically
27 selected if the desired interface starts with "tap" or if no
28 interface name is given.
29
30 -f tun-clone-device
31 Specifies the tun clone device name. The default is
32 /dev/net/tun, but some systems use /dev/misc/net/tun instead.
33
34 -d interfacename
35 Delete the specified interfacename (set it to non-persistent)
36
37 -u user
38 Specifies the owner of the interface. This user is allowed to
39 attach to the "network/wire" side.
40
41 -g group
42 Specifies the group of the interface. This group is allowed to
43 attach to the "network/wire" side of the interface.
44
45 -t interface
46 Specifies the desired interface name.
47
49 To create an interface for use by a particular user, invoke tunctl
50 without the -d option:
51
52 # tunctl -u someuser
53
54 Set 'tap0' persistent and owned by 'someuser'
55
56
57
58 Then, configure the interface as normal:
59
60 # ifconfig tap0 192.168.0.254 up
61
62 # route add -host 192.168.0.253 dev tap0
63
64 # bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
65
66 # arp -Ds 192.168.0.253 eth0 pub
67
68
69
70 To delete the interface, use the -d option:
71
72 # tunctl -d tap0
73
74 Set 'tap0' nonpersistent
75
76
77
79 The UserModeLinux-HOWTO <URL:http://user-mode-linux.source‐
80 forge.net/old/UserModeLinux-HOWTO.html>
81
83 tunctl was originally written by Jeff Dike <jdike@karaya.com> as part
84 of the User Mode Linux tools. Current version is maintained as a sepa‐
85 rate package by Henrik Nordstrom <henrik@henriknordstrom.net>.
86
87 This manual page was originally written by Matt Zimmerman
88 <mdz@debian.org> for the Debian GNU/Linux system, based on examples
89 from Jeff Dike. Extended by Henrik Nordstrom <henrik@henriknord‐
90 strom.net> to cover all options supported.
91
92
93
94 July 9, 2008 TUNCTL(8)