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