1.\" $OpenBSD: mpw.4,v 1.3 2015/07/21 15:19:34 jmc Exp $ 2.\" 3.\" Copyright (C) 2015 Rafael Zalamena <rzalamena@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: July 21 2015 $ 18.Dt MPW 4 19.Os 20.Sh NAME 21.Nm mpw 22.Nd MPLS pseudowire 23.Sh SYNOPSIS 24.Cd "pseudo-device mpw" 25.Pp 26.In sys/types.h 27.In netmpls/mpls.h 28.Sh DESCRIPTION 29The 30.Nm 31interface is used to create an MPLS layer 2 tunnel between two points. 32.Pp 33A 34.Nm 35interface can be created at runtime using the 36.Sy ifconfig Nm Ns Ar N Cm create 37command or by setting up a 38.Xr hostname.if 5 39configuration file for 40.Xr netstart 8 . 41The interface itself can be configured with 42.Xr ifconfig 8 . 43.Pp 44The supported pseudowire operation modes are 45.Ql ethernet 46and 47.Ql ethernet-tagged . 48The 49.Ql ethernet 50operating mode passes all Ethernet packets transparently through the 51interface, meanwhile the 52.Ql ethernet-tagged 53requires that the client uses at least one VLAN to pass the traffic. 54The 55.Nm 56interface labels, neighbor, encapsulation and administrative state are normally 57configured by 58.Xr ldpd 8 , 59but it is also possible to configure them manually. 60The configuration information that will be used by the ioctl are 61defined below: 62.Bd -literal 63#define IMR_TYPE_NONE 0 64#define IMR_TYPE_ETHERNET 1 65#define IMR_TYPE_ETHERNET_TAGGED 2 66 67#define IMR_FLAG_CONTROLWORD 0x1 68 69struct ifmpwreq { 70 uint32_t imr_flags; 71 uint32_t imr_type; /* pseudowire type */ 72 struct shim_hdr imr_lshim; /* local label */ 73 struct shim_hdr imr_rshim; /* remote label */ 74 struct sockaddr_storage imr_nexthop; 75}; 76.Ed 77.Pp 78.Nm 79interfaces support the following unique ioctls: 80.Bl -tag -width "SIOCSETMPWCFG" -offset 3n 81.It Dv SIOCSETMPWCFG 82Configure mpw using the supplied configuration. 83.It Dv SIOCGETMPWCFG 84Report the mpw configuration. 85.El 86.Sh EXAMPLES 87Create a pseudowire to neighbor 10.254.0.1 using Ethernet encapsulation 88with local label 20 and encapsulate MPLS packets with label 21: 89.Bd -literal -offset indent 90# ifconfig mpw5 neighbor 10.254.0.1 encap ethernet mpwlabel 20 21 up 91.Ed 92.Pp 93Create a pseudowire to neighbor 10.254.0.3 using Ethernet encapsulation 94with local label 30 and encapsulate MPLS packets with label 31 and 95control-word: 96.Bd -literal -offset indent 97# ifconfig mpw5 neighbor 10.254.0.3 encap ethernet mpwlabel 30 31 controlword 98.Ed 99.Sh SEE ALSO 100.Xr hostname.if 5 , 101.Xr ifconfig 8 , 102.Xr ldpd 8 , 103.Xr netstart 8 104.Sh HISTORY 105The 106.Nm 107kernel interface first appeared in 108.Ox 5.8 . 109.Sh AUTHORS 110The 111.Nm 112driver was written by 113.An Rafael Zalamena Aq Mt rzalamena@openbsd.org . 114