1.\" $OpenBSD: vxlan.4,v 1.10 2021/01/02 09:56:16 dlg Exp $ 2.\" 3.\" Copyright (c) 2013 Reyk Floeter <reyk@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: January 2 2021 $ 18.Dt VXLAN 4 19.Os 20.Sh NAME 21.Nm vxlan 22.Nd Virtual eXtensible Local Area Network tunnel interface 23.Sh SYNOPSIS 24.Cd "pseudo-device vxlan" 25.Sh DESCRIPTION 26The 27.Nm 28interface is a tunnelling pseudo-device for overlaying virtualized 29layer 2 networks over layer 3 networks. 30.Pp 31A 32.Nm 33interface can be created using the 34.Ic ifconfig vxlan Ns Ar N Ic create 35command. 36Once configured, the interface encapsulates and decapsulates Ethernet 37frames in UDP datagrams that are exchanged with tunnel endpoints. 38The default UDP port for VXLAN traffic is 4789. 39.Pp 40Each 41.Nm 42interface uses a 24-bit 43.Ic vnetid 44(virtual networks identifier) 45that distinguishes multiple virtualized layer 2 networks and 46their tunnels between identical tunnel endpoints. 47.Pp 48The interface can operate in the following tunnel modes: 49.Bl -tag -width multicast 50.It Ic unicast mode 51When a unicast IP address is configured as the tunnel destination, 52all traffic is sent to a single tunnel endpoint. 53.It Ic multicast mode 54When a multicast IP address is configured as the tunnel destination, 55all traffic is sent to all the tunnel endpoints that subscribed for the 56specified multicast group. 57.It Ic dynamic mode 58When 59.Nm 60is configured for multicast mode and added to a 61.Xr bridge 4 , 62all broadcast and multicast traffic is sent to the multicast group, 63but directed traffic is sent to unicast IP addresses of individual tunnel 64endpoints as they are learned by the bridge. 65.It Ic multipoint mode 66When 67.Nm 68is configured with 69.Ic vnetid any 70and added to a 71.Xr bridge 4 , 72all return traffic is sent to the known tunnel endpoints 73as they are learned by the bridge. 74In this mode, 75.Nm 76does not use a specific virtual network identifier but learns the ones 77of the individual tunnel endpoints. 78It is used to dynamically bridge many virtual networks together. 79.El 80.Pp 81The configuration can be done at runtime or by setting up a 82.Xr hostname.if 5 83configuration file for 84.Xr netstart 8 . 85.Pp 86For correct operation, encapsulated traffic must not be routed 87over the interface itself. 88This can be implemented by adding a distinct or a more specific 89route to the tunnel destination than the hosts or networks routed 90via the tunnel interface. 91Alternatively, the tunnel traffic may be configured in a separate 92routing table to the encapsulated traffic. 93.Sh EXAMPLES 94Create a tunnel to a unicast tunnel endpoint, using the virtual tunnel 95identifier 5: 96.Bd -literal -offset indent 97# ifconfig vxlan0 tunnel 192.168.1.100 192.168.1.200 vnetid 5 98# ifconfig vxlan0 10.1.1.100/24 99.Ed 100.Pp 101The following examples creates a dynamic tunnel that is attached to a 102.Xr bridge 4 : 103.Bd -literal -offset indent 104# ifconfig vxlan0 tunnel 192.168.1.100 239.1.1.100 vnetid 7395 105# ifconfig vxlan0 10.1.2.100/24 106# ifconfig bridge0 add vxlan0 up 107.Ed 108.Pp 109Prior to the assignment of UDP port 4789 by IANA, some early VXLAN 110implementations used port 8472. 111A non-standard port can be specified with the tunnel destination 112address: 113.Bd -literal -offset indent 114# ifconfig vxlan0 tunnel 192.168.1.100 239.1.1.100:8472 115.Ed 116.Sh SECURITY 117.Nm 118does not provide any integrated security features. 119It is designed to be a simple protocol that can be used in trusted 120data center environments, to carry VM traffic between virtual machine 121hypervisors, and provide virtualized layer 2 networks in Cloud 122infrastructures. 123.Pp 124To protect 125.Nm 126tunnels, the traffic can be protected with IPsec to add authentication 127and encryption for confidentiality. 128.Pp 129The Packet Filter (PF) can be used to filter tunnel traffic with 130endpoint policies in 131.Xr pf.conf 5 : 132.Bd -literal -offset indent 133table <vxlantep> { 192.168.1.200, 192.168.1.201 } 134block in on em0 135pass out on em0 136pass in on em0 proto udp from <vxlantep> to port vxlan 137.Ed 138.Pp 139The Time-to-Live (TTL) value of the tunnel can be set to 1 or a low 140value to restrict the traffic to the local network: 141.Bd -literal -offset indent 142# ifconfig vxlan0 tunnelttl 1 143.Ed 144.Sh SEE ALSO 145.Xr bridge 4 , 146.Xr inet 4 , 147.Xr hostname.if 5 , 148.Xr ifconfig 8 , 149.Xr netstart 8 150.Sh STANDARDS 151.Rs 152.%A M. Mahalingam 153.%A D. Dutt 154.%A K. Duda 155.%A P. Agarwal 156.%A L. Kreeger 157.%A T. Sridhar 158.%A M. Bursell 159.%A C. Wright 160.%D May 2013 161.%R draft-mahalingam-dutt-dcops-vxlan-04 162.%T VXLAN: A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks 163.Re 164.Sh HISTORY 165The 166.Nm 167device first appeared in 168.Ox 5.5 . 169.Sh AUTHORS 170The 171.Nm 172driver was written by 173.An Reyk Floeter Aq Mt reyk@openbsd.org . 174.Sh CAVEATS 175The 176.Nm 177interface requires at least 50 bytes for the IP, UDP and VXLAN 178protocol overhead and optionally 4 bytes for the encapsulated VLAN tag. 179The default MTU is set to 1500 bytes but can be adjusted if the 180transport interfaces carrying the tunnel traffic do not support larger 181MTUs, the tunnel traffic is leaving the local network, or if 182interoperability with another implementation requires running a 183decreased MTU of 1450 bytes. 184In any other case, it is commonly recommended to set the MTU of the 185transport interfaces to at least 1600 bytes. 186.Pp 187The implementation does not support IPv6 multicast tunnel endpoints at 188present. 189