From af2f6d264a9a669bc30ff22b0b741e9c1e7e68a0 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Thu, 26 Aug 2010 14:04:47 +0000 Subject: Try to be a bit more specific about what happens when link0 is used. link0 will reset the interface and all configuration is lost (e.g. -inet6 or rdomain settings) so use link0 as first command without any other arguments to get a deterministic behaviour. With a lot of help by jmc@ (actually commiting his version because it is much nicer, as ususal). --- share/man/man4/tun.4 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'share/man') diff --git a/share/man/man4/tun.4 b/share/man/man4/tun.4 index 7f534cce6e9..ebbd1a90713 100644 --- a/share/man/man4/tun.4 +++ b/share/man/man4/tun.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tun.4,v 1.36 2007/05/31 19:19:52 jmc Exp $ +.\" $OpenBSD: tun.4,v 1.37 2010/08/26 14:04:46 claudio Exp $ .\" .\" Copyright (c) 2003 Marcus D. Watts All rights reserved. .\" @@ -26,7 +26,7 @@ .\" TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE .\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: August 26 2010 $ .Dt TUN 4 .Os .Sh NAME @@ -53,18 +53,26 @@ interface can be created at runtime using the command or by opening the character special device .Pa /dev/tunN . .Pp -Both layer 3 and layer 2 tunneling is supported. -Layer 3 tunneling is the default mode; to enable layer 2 tunneling mode the +Both layer 3 and layer 2 tunneling is supported; +layer 3 tunneling is the default mode. +To enable layer 2 tunneling mode, +where the +.Nm +interface simulates an Ethernet network interface, +the .Ar link0 flag needs to be set with -.Xr ifconfig 8 , +.Xr ifconfig 8 or by setting up a .Xr hostname.if 5 configuration file for .Xr netstart 8 . -In layer 2 mode the +Note that setting or unsetting the +.Ar link0 +flag causes .Nm -interface is simulating an Ethernet network interface. +to lose any configuration settings, +and that it is not advisable to use the flag with any other parameters. .Pp Each device has the exclusive open property; it cannot be opened if it is already open and in use by another process. -- cgit v1.2.3