xref: /netbsd-src/share/man/man4/l2tp.4 (revision 796c32c94f6e154afc9de0f63da35c91bb739b45)
1.\"	$NetBSD: l2tp.4,v 1.2 2017/02/16 14:00:26 wiz Exp $
2.\"
3.\" Copyright (C) 2017 Internet Initiative Japan Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the project nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.Dd January 19, 2017
31.Dt L2TP 4
32.Os
33.Sh NAME
34.Nm l2tp
35.Nd layer two tunneling protocol version 3
36.Sh SYNOPSIS
37.Cd "pseudo-device l2tp"
38.Sh DESCRIPTION
39The
40.Nm
41interface is a version 3 of the Layer Two Tunneling Protocol (L2TPv3)
42pseudo device.
43It can tunnel layer 2 protocol traffic over IPv4 or IPv6, as specified in
44.Li RFC3931 .
45.Pp
46The L2TPv3 protocol is comprised of two types of messages, control messages
47and data messages.
48Control messages are used in the establishment,
49maintenace, and clearing of control connections and sessions.
50The
51.Nm
52interface can send control messages and data messages; furthermore
53the management of control messages is entrusted to userland daemon.
54Without a management daemon, the
55.Nm
56interface can send data messages using the
57.Xr ifconfig 8
58.Cm tunnel
59and
60.Cm session
61subcommands, or the
62.Dv SIOCSIFPHYADDR
63and
64.Dv SIOCSL2TPSESSION
65ioctls.
66Additionally, it can use cookies specified in
67.Li RFC3931
68by using the
69.Xr ifconfig 8
70.Cm cookie
71subcommand, or the
72.Dv SIOCSL2TPCOOKIE
73ioctl.
74.Ss Packet format
75Layer 2 frames are prepended with a L2TPv3 header as described by
76RFC 3931.
77The resulting L2TPv3 packets will be encapsulated in an outer packet,
78which may be either an IPv4 or IPv6 packet, with IP protocol number 115.
79.Sh EXAMPLES
80Configuration example:
81.Bd -literal
82Host X--NetBSD A  ----------------tunnel---------- NetBSD B------Host E
83           \\                                          |
84            \\                                        /
85             +-----Router B--------Router C---------+
86.Ed
87configuration example without cookies,
88.Pp
89On
90.Nx
91system A
92.Bd -literal
93# ifconfig wm0 inet 192.168.0.1/24
94# ifconfig l2tp0 create
95# ifconfig l2tp0 tunnel 192.168.0.1 192.168.0.2
96# ifconfig l2tp0 session 1234 4321
97# ifconfig bridge0 create
98# brconfig bridge0 add wm1
99# brconfig bridge0 add l2tp0
100# ifconfig l2tp0 up
101# ifconfig wm1 up
102# ifconfig bridge0 up
103.Ed
104.Pp
105On
106.Nx
107system B
108.Bd -literal
109# ifconfig wm0 inet 192.168.0.2/24
110# ifconfig l2tp0 create
111# ifconfig l2tp0 tunnel 192.168.0.2 192.168.0.1
112# ifconfig l2tp0 session 4321 1234
113# ifconfig bridge0 create
114# brconfig bridge0 add wm1
115# brconfig bridge0 add l2tp0
116# ifconfig l2tp0 up
117# ifconfig wm1 up
118# ifconfig bridge0 up
119.Ed
120.Pp
121configuration example with cookies,
122.Pp
123On
124.Nx
125system A
126.Bd -literal
127# ifconfig wm0 inet 192.168.0.1/24
128# ifconfig l2tp0 create
129# ifconfig l2tp0 tunnel 192.168.0.1 192.168.0.2
130# ifconfig l2tp0 session 1234 4321
131# ifconfig l2tp0 cookie 4 12345 4 54321
132# ifconfig bridge0 create
133# brconfig bridge0 add wm1
134# brconfig bridge0 add l2tp0
135# ifconfig l2tp0 up
136# ifconfig wm1 up
137# ifconfig bridge0 up
138.Ed
139.Pp
140On
141.Nx
142system B
143.Bd -literal
144# ifconfig wm0 inet 192.168.0.2/24
145# ifconfig l2tp0 create
146# ifconfig l2tp0 tunnel 192.168.0.2 192.168.0.1
147# ifconfig l2tp0 session 4321 1234
148# ifconfig l2tp0 cookie 4 54321 4 12345
149# ifconfig bridge0 create
150# brconfig bridge0 add wm1
151# brconfig bridge0 add l2tp0
152# ifconfig l2tp0 up
153# ifconfig wm1 up
154# ifconfig bridge0 up
155.Ed
156.Sh SEE ALSO
157.Xr inet 4 ,
158.Xr inet6 4 ,
159.Xr ifconfig 8
160.Rs
161.%A J. Lau, Ed.
162.%A M. Townsley, Ed.
163.%A I. Goyret, Ed.
164.%B RFC 3931
165.%T Layer Two Tunneling Protocol - Version 3 (L2TPv3)
166.%D March 2005
167.%U ftp://ftp.ietf.org/rfc/rfc3931.txt
168.Re
169.Sh HISTORY
170The
171.Nm
172device first appeared in
173.Nx 8.0 .
174.Sh BUGS
175Currently, the
176.Nm
177interface supports Ethernet frames over IPv4 or IPv6 only.
178