summaryrefslogtreecommitdiff
path: root/share/man/man4/mpw.4
blob: 46877799eded8e8cfb97291bd5e1f6e50ff3912c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.\"	$OpenBSD: mpw.4,v 1.1 2015/07/21 05:25:24 rzalamena Exp $
.\"
.\" Copyright (C) 2015 Rafael Zalamena <rzalamena@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: July 21 2015 $
.Dt MPW 4
.Os
.Sh NAME
.Nm mpw
.Nd MPLS Pseudowire
.Sh SYNOPSIS
.Cd "pseudo-device mpw"
.Pp
.Fd #include <sys/types.h>
.Fd #include <netmpls/mpls.h>
.Sh DESCRIPTION
The
.Nm
interface is used to create a MPLS layer 2 tunnel between two points.
.Pp
A
.Nm
interface can be created at runtime using the
.Ic ifconfig mpw Ns Ar N Ic create
command or by setting up a
.Xr hostname.if 5
configuration file for
.Xr netstart 8 .
The interface itself can be configured with
.Xr ifconfig 8
see its man page for more information.
.Pp
The supported pseudowire operation modes are
.Ql ethernet
and
.Ql ethernet-tagged .
The
.Ql ethernet
operating mode passes all ethernet packets transparently through the
interface, meanwhile the
.Ql ethernet-tagged
requires that the client uses at least one VLAN to pass the traffic.
The
.Nm
interface labels, neighbor, encapsulation and administrative state is normally
configured by
.Xr ldpd 8 ,
but it is also possible to configure it manually.
The configuration information that will be used by the ioctl are
defined below:
.Bd -literal
#define IMR_TYPE_NONE                   0
#define IMR_TYPE_ETHERNET               1
#define IMR_TYPE_ETHERNET_TAGGED        2

#define IMR_FLAG_CONTROLWORD            0x1

struct ifmpwreq {
        uint32_t        imr_flags;
        uint32_t        imr_type; /* pseudowire type */
        struct          shim_hdr imr_lshim; /* local label */
        struct          shim_hdr imr_rshim; /* remote label */
        struct          sockaddr_storage imr_nexthop;
};
.Ed
.Pp
.Nm
interfaces support the following unique ioctls:
.Bl -tag -width "SIOCSETMPWCFG" -offset 3n
.It SIOCSETMPWCFG
Configure mpw using the supplied configuration.
.It SIOCGETMPWCFG
Report the mpw configuration.
.El
.\"
.Sh EXAMPLES
Create a pseudowire to neighbor 10.254.0.1 using ethernet encapsulation
with local label 20 and encapsulate MPLS packets with label 21:
.Bd -literal -offset indent
# ifconfig mpw5 neighbor 10.254.0.1 encap ethernet mpwlabel 20 21 up
.Ed
.Pp
Create a pseudowire to neighbor 10.254.0.3 using ethernet encapsulation
with local label 30 and encapsulate MPLS packets with label 31 and
control-word:
.Bd -literal -offset indent
# ifconfig mpw5 neighbor 10.254.0.3 encap ethernet mpwlabel 30 31 controlword
.Ed
.Pp
.Sh SEE ALSO
.Xr hostname.if 5 ,
.Xr ifconfig 8 ,
.Xr ldpd 8 ,
.Xr netstart 8
.\"
.Sh HISTORY
The
.Nm
kernel interface first appeared in
.Ox 5.8 .
.\"
.Sh AUTHORS
The
.Nm
driver was written by
.An Rafael Zalamena Aq Mt rzalamena@openbsd.org .