1.\" 2.\" Copyright (c) 2001 Yar Tikhiy 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.\" $FreeBSD$ 27.\" 28.Dd October 4, 2004 29.Dt VLAN 4 30.Os 31.Sh NAME 32.Nm vlan 33.Nd IEEE 802.1Q VLAN network interface 34.Sh SYNOPSIS 35.Cd device miibus 36.Cd device vlan 37.\" 38.Sh DESCRIPTION 39The 40.Nm 41driver demultiplexes frames tagged according to 42the IEEE 802.1Q standard into logical 43.Nm 44network interfaces, which allows routing/bridging between 45multiple VLANs through a single switch trunk port. 46.Pp 47Each 48.Nm 49interface is created at runtime using interface cloning. 50This is 51most easily done with the 52.Xr ifconfig 8 53.Cm create 54command or using the 55.Va cloned_interfaces 56variable in 57.Xr rc.conf 5 . 58.Pp 59To function, a 60.Nm 61interface must be assigned a parent interface and 62numeric VLAN tag using 63.Xr ifconfig 8 . 64A single parent can be assigned to multiple 65.Nm 66interfaces provided they have different tags. 67The parent interface is likely to be an ethernet card connected 68to a properly configured switch port. 69The VLAN tag should match one of those set up in the switched 70network. 71.Pp 72The 73.Nm 74driver supports physical devices that do 75the VLAN demultiplexing in firmware. 76Devices that have hardware support for 77802.1Q VLANs are automatically recognized by their interface capabilities. 78.\" 79.Ss "Selecting the Right Network Interface Card to Run VLANs Through" 80By now, the only NICs that have both hardware support and proper 81driver hooks for the 802.1Q VLAN technology in 82.Fx 83are 84.Xr bge 4 , 85.Xr em 4 , 86.Xr gx 4 , 87.Xr nge 4 , 88.Xr re 4 , 89.Xr ti 4 , 90and 91.Xr txp 4 . 92.Pp 93The rest of the ethernet NICs supported by 94.Fx 95can run 96VLANs using software emulation in the 97.Nm 98driver. 99However, most of them lack the capability 100of transmitting and/or receiving oversized frames. 101Using such a NIC as a parent interface 102implies a reduced MTU on the corresponding 103.Nm 104interfaces. 105In the modern Internet, this is likely to cause 106.Xr tcp 4 107connectivity problems due to massive, inadequate 108.Xr icmp 4 109filtering that breaks the Path MTU Discovery mechanism. 110.Pp 111The NICs that support oversized frames are as follows: 112.Bl -tag -width ".Xr fxp 4 " -offset indent 113.It Xr bfe 4 114supports long frames for 115.Nm 116natively. 117.It Xr dc 4 118supports long frames for 119.Nm 120natively. 121.It Xr de 4 122requires defining 123.Dv BIG_PACKET 124in the 125.Pa /usr/src/sys/pci/if_de.c 126source file and rebuilding the kernel 127or module. 128The hack works only for the 21041, 21140, and 21140A chips. 129.It Xr fxp 4 130supports long frames for 131.Nm 132natively. 133.It Xr hme 4 134supports long frames for 135.Nm 136natively. 137.It Xr rl 4 138supports long frames for 139.Nm 140natively. 141.It Xr sis 4 142supports long frames for 143.Nm 144natively. 145.It Xr ste 4 146supports long frames for 147.Nm 148natively. 149.It Xr tl 4 150has support for long frames. 151.It Xr tx 4 152supports long frames for 153.Nm 154natively. 155.It Xr xl 4 156supports long frames only if the card is built on a newer chip 157(Cyclone and above). 158.El 159.Pp 160The 161.Nm 162driver automatically recognizes devices that support oversized frames 163for 164.Nm 165use and calculates the appropriate frame MTU based on the 166capabilities of the parent interface. 167.Sh SEE ALSO 168.Xr miibus 4 , 169.Xr ifconfig 8 170.Sh BUGS 171No 802.1Q features except VLAN tagging are implemented. 172