Changeset View
Changeset View
Standalone View
Standalone View
share/man/man4/tun.4
.\" $NetBSD: tun.4,v 1.1 1996/06/25 22:17:37 pk Exp $ | .\" $NetBSD: tun.4,v 1.1 1996/06/25 22:17:37 pk Exp $ | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" Based on PR#2411 | .\" Based on PR#2411 | ||||
.\" | .\" | ||||
.Dd November 29, 2017 | .Dd April 29, 2019 | ||||
.Dt TUN 4 | .Dt TUN 4 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm tun | .Nm tun | ||||
.Nd tunnel software network interface | .Nd tunnel software network interface | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Cd device tun | .Cd device tuntap | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
interface is a software loopback mechanism that can be loosely | interface is a software loopback mechanism that can be loosely | ||||
described as the network interface analog of the | described as the network interface analog of the | ||||
.Xr pty 4 , | .Xr pty 4 , | ||||
that is, | that is, | ||||
.Nm | .Nm | ||||
Show All 26 Lines | |||||
.Dq control | .Dq control | ||||
interface. | interface. | ||||
.Pp | .Pp | ||||
The network interfaces are named | The network interfaces are named | ||||
.Dq Li tun0 , | .Dq Li tun0 , | ||||
.Dq Li tun1 , | .Dq Li tun1 , | ||||
etc., one for each control device that has been opened. | etc., one for each control device that has been opened. | ||||
These network interfaces persist until the | These network interfaces persist until the | ||||
.Pa if_tun.ko | .Pa if_tuntap.ko | ||||
module is unloaded, or until removed with the | module is unloaded, or until removed with the | ||||
.Xr ifconfig 8 | .Xr ifconfig 8 | ||||
command. | command. | ||||
.Pp | .Pp | ||||
.Nm | .Nm | ||||
devices are created using interface cloning. | devices are created using interface cloning. | ||||
This is done using the | This is done using the | ||||
.Dq ifconfig tun Ns Sy N No create | .Dq ifconfig tun Ns Sy N No create | ||||
Show All 30 Lines | |||||
such as | such as | ||||
.Xr ppp 8 | .Xr ppp 8 | ||||
and | and | ||||
.Xr ssh 1 . | .Xr ssh 1 . | ||||
It therefore defaults to being enabled until further notice. | It therefore defaults to being enabled until further notice. | ||||
.Ef | .Ef | ||||
.Pp | .Pp | ||||
Control devices (once successfully opened) persist until | Control devices (once successfully opened) persist until | ||||
.Pa if_tun.ko | .Pa if_tuntap.ko | ||||
is unloaded in the same way that network interfaces persist (see above). | is unloaded in the same way that network interfaces persist (see above). | ||||
.Pp | .Pp | ||||
Each interface supports the usual network-interface | Each interface supports the usual network-interface | ||||
.Xr ioctl 2 Ns s , | .Xr ioctl 2 Ns s , | ||||
such as | such as | ||||
.Dv SIOCAIFADDR | .Dv SIOCAIFADDR | ||||
and thus can be used with | and thus can be used with | ||||
.Xr ifconfig 8 | .Xr ifconfig 8 | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |