Deleted Added
full compact
tun.4 (163175) tun.4 (166497)
1.\" $NetBSD: tun.4,v 1.1 1996/06/25 22:17:37 pk Exp $
1.\" $NetBSD: tun.4,v 1.1 1996/06/25 22:17:37 pk Exp $
2.\" $FreeBSD: head/share/man/man4/tun.4 163175 2006-10-09 19:53:00Z trhodes $
2.\" $FreeBSD: head/share/man/man4/tun.4 166497 2007-02-04 16:32:46Z bms $
3.\" Based on PR#2411
4.\"
3.\" Based on PR#2411
4.\"
5.Dd October 9, 2006
5.Dd February 4, 2007
6.Dt TUN 4
7.Os
8.Sh NAME
9.Nm tun
10.Nd tunnel software network interface
11.Sh SYNOPSIS
12.Cd device tun
13.Sh DESCRIPTION

--- 23 unchanged lines hidden (view full) ---

37interface.
38.Pp
39The network interfaces are named
40.Dq Li tun0 ,
41.Dq Li tun1 ,
42etc., one for each control device that has been opened.
43These network interfaces persist until the
44.Pa if_tun.ko
6.Dt TUN 4
7.Os
8.Sh NAME
9.Nm tun
10.Nd tunnel software network interface
11.Sh SYNOPSIS
12.Cd device tun
13.Sh DESCRIPTION

--- 23 unchanged lines hidden (view full) ---

37interface.
38.Pp
39The network interfaces are named
40.Dq Li tun0 ,
41.Dq Li tun1 ,
42etc., one for each control device that has been opened.
43These network interfaces persist until the
44.Pa if_tun.ko
45module is unloaded (if
45module is unloaded, or until removed with the
46.Xr ifconfig 8
47command.
48.Pp
46.Nm
49.Nm
47is built into your kernel, the network interfaces cannot be removed).
50devices are created using interface cloning.
51This is done using the
52.Dq ifconfig tap Ns Sy N No create
53command.
54This is the preferred method of creating
55.Nm
56devices.
57The same method allows removal of interfaces.
58For this, use the
59.Dq ifconfig tap Ns Sy N No destroy
60command.
48.Pp
61.Pp
49The
62If the
63.Xr sysctl 8
64variable
65.Va net.link.tun.devfs_cloning
66is non-zero, the
50.Nm
51interface
52permits opens on the special control device
53.Pa /dev/tun .
54When this device is opened,
55.Nm
56will return a handle for the lowest unused
57.Nm
58device (use
59.Xr devname 3
60to determine which).
67.Nm
68interface
69permits opens on the special control device
70.Pa /dev/tun .
71When this device is opened,
72.Nm
73will return a handle for the lowest unused
74.Nm
75device (use
76.Xr devname 3
77to determine which).
78.Pp
79.Bf Em
80Disabling the legacy devfs cloning functionality may break existing
81applications which use
82.Nm ,
83such as
84.Xr ppp 8
85and
86.Xr ssh 1 .
87It therefore defaults to being enabled until further notice.
88.Ef
89.Pp
61Control devices (once successfully opened) persist until
62.Pa if_tun.ko
63is unloaded in the same way that network interfaces persist (see above).
64.Pp
65Each interface supports the usual network-interface
66.Xr ioctl 2 Ns s ,
67such as
68.Dv SIOCAIFADDR

--- 216 unchanged lines hidden ---
90Control devices (once successfully opened) persist until
91.Pa if_tun.ko
92is unloaded in the same way that network interfaces persist (see above).
93.Pp
94Each interface supports the usual network-interface
95.Xr ioctl 2 Ns s ,
96such as
97.Dv SIOCAIFADDR

--- 216 unchanged lines hidden ---