xref: /freebsd/share/man/man4/vlan.4 (revision 6af83ee0d2941d18880b6aaa2b4facd1d30c6106)
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 January 30, 2005
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.Sh HARDWARE
72The
73.Nm
74driver supports efficient operation over parent interfaces that can provide
75help in processing VLANs.
76Such interfaces are automatically recognized by their capabilities.
77Depending on the level of sophistication found in a physical
78interface, it may do full VLAN processing or just be able to
79receive and transmit frames exceeding the maximum Ethernet frame size
80by the length of a 802.1Q header.
81The capabilities may be user-controlled by the respective parameters to
82.Xr ifconfig 8 ,
83.Cm vlanhwtag
84and
85.Cm vlanmtu .
86However, a physical interface is not obliged to react to them:
87It may have either capability enabled permanently without
88a way to turn it off.
89The whole issue is very specific to a particular device and its driver.
90.Pp
91By now, the list of physical interfaces able of full VLAN processing
92in the hardware is limited to the following devices:
93.Xr bge 4 ,
94.Xr em 4 ,
95.Xr ixgb 4 ,
96.Xr nge 4 ,
97.Xr re 4 ,
98.Xr ti 4 ,
99.Xr txp 4 ,
100and
101.Xr vge 4 .
102.Pp
103The rest of the Ethernet interfaces can run
104VLANs using software emulation in the
105.Nm
106driver.
107However, most of them lack the capability
108of transmitting and receiving oversized frames.
109Assigning such an interface as the parent to
110.Nm
111will result in a reduced MTU on the corresponding
112.Nm
113interfaces.
114In the modern Internet, this is likely to cause
115.Xr tcp 4
116connectivity problems due to massive, inadequate
117.Xr icmp 4
118filtering that breaks the Path MTU Discovery mechanism.
119.Pp
120The interfaces that support oversized frames are as follows:
121.Bl -tag -width ".Xr fxp 4 " -offset indent
122.It Xr bfe 4
123supports long frames for
124.Nm
125natively.
126.It Xr dc 4
127supports long frames for
128.Nm
129natively.
130.It Xr de 4
131requires defining
132.Dv BIG_PACKET
133in the
134.Pa /usr/src/sys/pci/if_de.c
135source file and rebuilding the kernel
136or module.
137The hack works only for the 21041, 21140, and 21140A chips.
138.It Xr fxp 4
139supports long frames for
140.Nm
141natively.
142.It Xr hme 4
143supports long frames for
144.Nm
145natively.
146.It Xr rl 4
147supports long frames for
148.Nm
149natively.
150.It Xr sis 4
151supports long frames for
152.Nm
153natively.
154.It Xr ste 4
155supports long frames for
156.Nm
157natively.
158.It Xr tl 4
159has support for long frames.
160.It Xr tx 4
161supports long frames for
162.Nm
163natively.
164.It Xr xl 4
165supports long frames only if the card is built on a newer chip
166(Cyclone and above).
167.El
168.Pp
169The
170.Nm
171driver automatically recognizes devices that natively support oversized frames
172for
173.Nm
174use and calculates the appropriate frame MTU based on the
175capabilities of the parent interface.
176The other interfaces listed above can handle oversized frames,
177but they do not advertise this ability of theirs.
178The MTU setting on
179.Nm
180can be corrected manually if used in conjunction with such parent interface.
181.Sh SEE ALSO
182.Xr kqueue 2 ,
183.Xr miibus 4 ,
184.Xr ifconfig 8
185.Sh BUGS
186No 802.1Q features except VLAN tagging are implemented.
187.Pp
188.Dv EVFILT_NETDEV
189events on a
190.Nm
191interface will be sent through
192.Xr kqueue 2
193only if the parent interface uses
194.Xr miibus 4
195for link state notification.
196