xref: /freebsd/share/man/man4/vlan.4 (revision 3642298923e528d795e3a30ec165d2b469e28b40)
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 August 28, 2005
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 support for the
36.Nm
37driver into your kernel, place the following lines in your
38kernel configuration file:
39.Bd -ragged -offset indent
40.Cd "device miibus"
41.Cd "device vlan"
42.Ed
43.Pp
44Alternatively, to load the
45.Nm
46driver at boot time, place the following line in
47.Xr loader.conf 5 :
48.Bd -literal -offset indent
49if_vlan_load="YES"
50.Ed
51.Sh DESCRIPTION
52The
53.Nm
54driver demultiplexes frames tagged according to
55the IEEE 802.1Q standard into logical
56.Nm
57network interfaces, which allows routing/bridging between
58multiple VLANs through a single switch trunk port.
59.Pp
60Each
61.Nm
62interface is created at runtime using interface cloning.
63This is
64most easily done with the
65.Xr ifconfig 8
66.Cm create
67command or using the
68.Va cloned_interfaces
69variable in
70.Xr rc.conf 5 .
71.Pp
72To function, a
73.Nm
74interface must be assigned a parent interface and
75numeric VLAN tag using
76.Xr ifconfig 8 .
77A single parent can be assigned to multiple
78.Nm
79interfaces provided they have different tags.
80The parent interface is likely to be an Ethernet card connected
81to a properly configured switch port.
82The VLAN tag should match one of those set up in the switched
83network.
84.Sh HARDWARE
85The
86.Nm
87driver supports efficient operation over parent interfaces that can provide
88help in processing VLANs.
89Such interfaces are automatically recognized by their capabilities.
90Depending on the level of sophistication found in a physical
91interface, it may do full VLAN processing or just be able to
92receive and transmit frames exceeding the maximum Ethernet frame size
93by the length of a 802.1Q header.
94The capabilities may be user-controlled by the respective parameters to
95.Xr ifconfig 8 ,
96.Cm vlanhwtag
97and
98.Cm vlanmtu .
99However, a physical interface is not obliged to react to them:
100It may have either capability enabled permanently without
101a way to turn it off.
102The whole issue is very specific to a particular device and its driver.
103.Pp
104By now, the list of physical interfaces able of full VLAN processing
105in the hardware is limited to the following devices:
106.Xr bge 4 ,
107.Xr em 4 ,
108.Xr ixgb 4 ,
109.Xr nge 4 ,
110.Xr re 4 ,
111.Xr ti 4 ,
112.Xr txp 4 ,
113and
114.Xr vge 4 .
115.Pp
116The rest of the Ethernet interfaces can run
117VLANs using software emulation in the
118.Nm
119driver.
120However, most of them lack the capability
121of transmitting and receiving oversized frames.
122Assigning such an interface as the parent to
123.Nm
124will result in a reduced MTU on the corresponding
125.Nm
126interfaces.
127In the modern Internet, this is likely to cause
128.Xr tcp 4
129connectivity problems due to massive, inadequate
130.Xr icmp 4
131filtering that breaks the Path MTU Discovery mechanism.
132.Pp
133The interfaces that support oversized frames are as follows:
134.Bl -tag -width ".Xr fxp 4 " -offset indent
135.It Xr bfe 4
136supports long frames for
137.Nm
138natively.
139.It Xr dc 4
140supports long frames for
141.Nm
142natively.
143.It Xr de 4
144requires defining
145.Dv BIG_PACKET
146in the
147.Pa /usr/src/sys/pci/if_de.c
148source file and rebuilding the kernel
149or module.
150The hack works only for the 21041, 21140, and 21140A chips.
151.It Xr fxp 4
152supports long frames for
153.Nm
154natively.
155.It Xr gem 4
156supports long frames for
157.Nm
158natively.
159.It Xr hme 4
160supports long frames for
161.Nm
162natively.
163.It Xr rl 4
164supports long frames for
165.Nm
166natively.
167.It Xr sis 4
168supports long frames for
169.Nm
170natively.
171.It Xr ste 4
172supports long frames for
173.Nm
174natively.
175.It Xr tl 4
176has support for long frames.
177.It Xr tx 4
178supports long frames for
179.Nm
180natively.
181.It Xr xl 4
182supports long frames only if the card is built on a newer chip
183(Cyclone and above).
184.El
185.Pp
186The
187.Nm
188driver automatically recognizes devices that natively support oversized frames
189for
190.Nm
191use and calculates the appropriate frame MTU based on the
192capabilities of the parent interface.
193The other interfaces listed above can handle oversized frames,
194but they do not advertise this ability of theirs.
195The MTU setting on
196.Nm
197can be corrected manually if used in conjunction with such parent interface.
198.Sh SEE ALSO
199.Xr kqueue 2 ,
200.Xr miibus 4 ,
201.Xr ifconfig 8
202.Sh BUGS
203No 802.1Q features except VLAN tagging are implemented.
204.Pp
205.Dv EVFILT_NETDEV
206events on a
207.Nm
208interface will be sent through
209.Xr kqueue 2
210only if the parent interface uses
211.Xr miibus 4
212for link state notification.
213