ip-tuntap: add page (#18858)

This commit is contained in:
Sainjargal Ishdorj
2025-10-20 13:30:39 +08:00
committed by GitHub
parent 01370785b8
commit e59bca96ce
+28
View File
@@ -0,0 +1,28 @@
# 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}}`