xref: /freebsd/share/man/man4/vlan.4 (revision fcb560670601b2a4d87bb31d7531c8dcc37ee71b)
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 June 4, 2012
29.Dt VLAN 4
30.Os
31.Sh NAME
32.Nm vlan
33.Nd "IEEE 802.1Q VLAN network interface"
34.Sh SYNOPSIS
35To compile this driver into the kernel,
36place the following line in your
37kernel configuration file:
38.Bd -ragged -offset indent
39.Cd "device vlan"
40.Ed
41.Pp
42Alternatively, to load the driver as a
43module at boot time, place the following line in
44.Xr loader.conf 5 :
45.Bd -literal -offset indent
46if_vlan_load="YES"
47.Ed
48.Sh DESCRIPTION
49The
50.Nm
51driver demultiplexes frames tagged according to
52the IEEE 802.1Q standard into logical
53.Nm
54network interfaces, which allows routing/bridging between
55multiple VLANs through a single switch trunk port.
56.Pp
57Each
58.Nm
59interface is created at runtime using interface cloning.
60This is
61most easily done with the
62.Xr ifconfig 8
63.Cm create
64command or using the
65.Va cloned_interfaces
66variable in
67.Xr rc.conf 5 .
68.Pp
69To function, a
70.Nm
71interface must be assigned a parent interface and
72numeric VLAN tag using
73.Xr ifconfig 8 .
74A single parent can be assigned to multiple
75.Nm
76interfaces provided they have different tags.
77The parent interface is likely to be an Ethernet card connected
78to a properly configured switch port.
79The VLAN tag should match one of those set up in the switched
80network.
81.Pp
82.Nm
83initially assumes the same minimum length for tagged and untagged frames.
84This mode is selected by setting the
85.Xr sysctl 8
86variable
87.Va net.link.vlan.soft_pad
88to 0
89.Pq default .
90However, there are network devices that fail to adjust frame length
91when it falls below the allowed minimum due to untagging.
92Such devices should be able to interoperate with
93.Nm
94after changing the value of
95.Va net.link.vlan.soft_pad
96to 1.
97In the latter mode,
98.Nm
99will pad short frames before tagging them
100so that their length is not less than the minimum value
101after untagging by the non-compliant devices.
102.Sh HARDWARE
103The
104.Nm
105driver supports efficient operation over parent interfaces that can provide
106help in processing VLANs.
107Such interfaces are automatically recognized by their capabilities.
108Depending on the level of sophistication found in a physical
109interface, it may do full VLAN processing or just be able to
110receive and transmit long frames (up to 1522 bytes including an Ethernet
111header and FCS).
112The capabilities may be user-controlled by the respective parameters to
113.Xr ifconfig 8 ,
114.Cm vlanhwtag ,
115and
116.Cm vlanmtu .
117However, a physical interface is not obliged to react to them:
118It may have either capability enabled permanently without
119a way to turn it off.
120The whole issue is very specific to a particular device and its driver.
121.Pp
122At present, these devices are capable of full VLAN processing
123in hardware:
124.Xr ae 4 ,
125.Xr age 4 ,
126.Xr alc 4 ,
127.Xr ale 4 ,
128.Xr bce 4 ,
129.Xr bge 4 ,
130.Xr bxe 4 ,
131.Xr cxgb 4 ,
132.Xr cxgbe 4 ,
133.Xr em 4 ,
134.Xr igb 4 ,
135.Xr ixgb 4 ,
136.Xr ixgbe 4 ,
137.Xr jme 4 ,
138.Xr msk 4 ,
139.Xr mxge 4 ,
140.Xr nxge 4 ,
141.Xr nge 4 ,
142.Xr re 4 ,
143.Xr sge 4 ,
144.Xr stge 4 ,
145.Xr ti 4 ,
146.Xr txp 4 ,
147and
148.Xr vge 4 .
149.Pp
150Other Ethernet interfaces can run VLANs using software emulation in the
151.Nm
152driver.
153However, some lack the capability
154of transmitting and receiving long frames.
155Assigning such an interface as the parent to
156.Nm
157will result in a reduced MTU on the corresponding
158.Nm
159interfaces.
160In the modern Internet, this is likely to cause
161.Xr tcp 4
162connectivity problems due to massive, inadequate
163.Xr icmp 4
164filtering that breaks the Path MTU Discovery mechanism.
165.Pp
166These interfaces natively support long frames for
167.Nm :
168.Xr axe 4 ,
169.Xr bfe 4 ,
170.Xr cas 4 ,
171.Xr dc 4 ,
172.Xr et 4 ,
173.Xr fwe 4 ,
174.Xr fxp 4 ,
175.Xr gem 4 ,
176.Xr hme 4 ,
177.Xr le 4 ,
178.Xr nfe 4 ,
179.Xr rl 4 ,
180.Xr sf 4 ,
181.Xr sis 4 ,
182.Xr sk 4 ,
183.Xr ste 4 ,
184.Xr tl 4 ,
185.Xr tx 4 ,
186.Xr vr 4 ,
187.Xr vte 4 ,
188and
189.Xr xl 4 .
190.Pp
191The
192.Nm
193driver automatically recognizes devices that natively support long frames
194for
195.Nm
196use and calculates the appropriate frame MTU based on the
197capabilities of the parent interface.
198Some other interfaces not listed above may handle long frames,
199but they do not advertise this ability.
200The MTU setting on
201.Nm
202can be corrected manually if used in conjunction with such a parent interface.
203.Sh SEE ALSO
204.Xr ifconfig 8 ,
205.Xr sysctl 8
206.Sh BUGS
207No 802.1Q features except VLAN tagging are implemented.
208