.\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\" Copyright 2019 Alyssa Ross .\" .\" This program is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see . .Dd December 15, 2019 .Dt MKTUNTAP 8 .Os Linux .Sh NAME .Nm mktuntap .Nd create and open a TUN or TAP device on a file descriptor, then exec .Sh SYNOPSIS .Nm .Fl ( n | p ) .Op Fl v .Op Fl E .Op Fl i Ar ifr_name .Ar fd .Ar prog... .Sh DESCRIPTION Create a TUN or TAP device named with format .Ar ifr_name , open it on file descriptor .Ar fd , set the TUNTAP_NAME variable in the environment to the name of the opened device, and then exec into .Ar prog . .Pp The arguments are as follows: .Bl -tag -width Ds .It Fl p Create a TAP device. Mutually exclusive with .Fl n . .It Fl n Create a TUN device. Mutually exclusive with .Fl p . .It Fl v Set the .Dv IFF_VNET_HDR flag on the device. .It Fl E Don't set the TUNTAP_NAME environment variable. Caution: if you use this without using .Fl i to set a static device name, it will be difficult to determine the device name later. .It Fl i Set the name for the device. If present, the character sequence .Dq %d will be replaced with a number to create a unique name. Default: .Dq tap%d or .Dq tun%d , as appropriate. .El .Sh EXIT STATUS .Ex -std See .Xr sysexits 3 for further details. .Sh SEE ALSO .Xr tunctl 8 , .Xr ip 8