Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-21 00:19:51 +00:00
parent c3f5e8d7ab
commit 8d00ec1c41
29 changed files with 728 additions and 15 deletions

33
tldr/linux/ip-tuntap Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# ip tuntap
> Manage TUN/TAP virtual network interfaces.
> More information: <https://baturin.org/docs/iproute2/#ip-tuntap>.
- Show all existing TUN/TAP devices:
`ip {{[tunt|tuntap]}}`
- Create a TUN device with a specific name:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tun0}} {{[m|mode]}} {{[t|tun]}}`
- Create a TAP device with a specific name:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tap0}} {{[m|mode]}} {{[ta|tap]}}`
- Delete a TUN or TAP device:
`sudo ip {{[tunt|tuntap]}} {{[d|delete]}} {{[d|dev]}} {{tun0|tap0}} {{[m|mode]}} {{tun|tap}}`
- Set the owner (UID) of a TUN/TAP device:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tun0|tap0}} {{[m|mode]}} {{tun|tap}} {{[u|user]}} {{username}}`
- Set both owner (UID) and group (GID) for a TUN/TAP device:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tun0|tap0}} {{[m|mode]}} {{tun|tap}} {{[u|user]}} {{username}} {{[g|group]}} {{group_name}}`