TUNCTL(8)
π tunctl(8) β like, the manual page, bestie
okay so this is tunctl, and it lives in section 8 of the manual (that's the sysadmin-y one, iykyk). she's a little tool with one job and she does it impeccably. let's get into it π«Ά
β¨ NAME β¨
tunctl β create and manage persistent TUN/TAP interfaces πΈ
π¦ SYNOPSIS π¦
tunctl [ OPTIONS ] [ -u owner ] [ -t device-name ]
tunctl -d device-name
like, that's the whole vibe. either you're making an interface or you're deleting one, no in-between π
π DESCRIPTION π
tunctl lets the host sysadmin preconfigure a TUN/TAP network interface so it's ready for a particular user before that user even shows up. iconic behaviour, honestly.
the deal is: that user gets to open and use the network/write side of the interface β the "wire" side, the fun side β but they can not change any aspects of the host side of the interface. that part stays locked down. main character energy on the user's side, zero admin powers, periodt. π₯
π OPTIONS π
-bβ brief output, bestie. prints just the interface name. no extra chatter, we love a minimalist.-nβ create a point-to-point TUN interface without an Ethernet header. this gets automatically enabled if the desired interface name starts with"tun"β she knows what you meant π§-pβ create a TAP type interface with an Ethernet header. automatically selected if the desired interface starts with"tap", or if you didn't give an interface name at all. slay, defaults π-ftun-clone-device β specifies the tun clone device name. the default is/dev/net/tun, but some systems use/dev/misc/net/tuninstead. not me checking your distro's vibe π-dinterfacename β delete the specified interfacename (i.e. set it to non-persistent). bye bestie π-uuser β specifies the owner of the interface. this user is allowed to attach to the"network/wire"side.-ggroup β specifies the group of the interface. this group is allowed to attach to the"network/wire"side of the interface.-tinterface β specifies the desired interface name. name her, don't be shy π
π USAGE π
β making one
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'
see how she told you exactly what she did? obsessed. π
β then configure it
then, configure the interface as normal β like, business as usual, no special tunctl magic here:
# 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
ngl that's a whole lot of commands but they're literally copy-pastable, so we're fine π«Ά
β deleting it
to delete the interface, use the -d option:
# tunctl -d tap0
Set 'tap0' nonpersistent
and that's it. she's gone, she's non-persistent, she's at peace β¨
π SEE ALSO π
the UserModeLinux-HOWTO β <URL:http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO.html> β go read it, iykyk π¦
π AUTHOR π
tunctl was originally written by Jeff Dike <jdike@karaya.com> as part of the User Mode Linux tools. the current version is maintained as a separate package by Henrik Nordstrom <henrik@henriknordstrom.net>. absolute legends, both of them π
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. the way they kept it completeβ¦ we stan a thorough queen π
β and that's the whole page! this version is dated 26 February 2024 and it's from the TUNCTL(8) manual (section 8, sysadmin club π). bye bestie, go make some interfaces πβ¨π¦
π¦ where this page comes from
- opensuse-leap 16.0: tunctl 1.5-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: tunctl 1.5-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: tunctl 1.5-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: tunctl 1.5-160000.2.2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms