xref: /freebsd/share/man/man4/vlan.4 (revision 86e3186efab0cee149e8a2efdef4bb75f1dade11)
179458d0bSYaroslav Tykhiy.\"
279458d0bSYaroslav Tykhiy.\" Copyright (c) 2001 Yar Tikhiy
379458d0bSYaroslav Tykhiy.\" All rights reserved.
479458d0bSYaroslav Tykhiy.\"
579458d0bSYaroslav Tykhiy.\" Redistribution and use in source and binary forms, with or without
679458d0bSYaroslav Tykhiy.\" modification, are permitted provided that the following conditions
779458d0bSYaroslav Tykhiy.\" are met:
879458d0bSYaroslav Tykhiy.\" 1. Redistributions of source code must retain the above copyright
979458d0bSYaroslav Tykhiy.\"    notice, this list of conditions and the following disclaimer.
1079458d0bSYaroslav Tykhiy.\" 2. Redistributions in binary form must reproduce the above copyright
1179458d0bSYaroslav Tykhiy.\"    notice, this list of conditions and the following disclaimer in the
1279458d0bSYaroslav Tykhiy.\"    documentation and/or other materials provided with the distribution.
1379458d0bSYaroslav Tykhiy.\"
1479458d0bSYaroslav Tykhiy.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1579458d0bSYaroslav Tykhiy.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1679458d0bSYaroslav Tykhiy.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1779458d0bSYaroslav Tykhiy.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1879458d0bSYaroslav Tykhiy.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1979458d0bSYaroslav Tykhiy.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2079458d0bSYaroslav Tykhiy.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2179458d0bSYaroslav Tykhiy.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2279458d0bSYaroslav Tykhiy.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2379458d0bSYaroslav Tykhiy.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2479458d0bSYaroslav Tykhiy.\" SUCH DAMAGE.
2579458d0bSYaroslav Tykhiy.\"
2679458d0bSYaroslav Tykhiy.\" $FreeBSD$
2779458d0bSYaroslav Tykhiy.\"
2886e3186eSTom Rhodes.Dd July 16, 2005
2979458d0bSYaroslav Tykhiy.Dt VLAN 4
3079458d0bSYaroslav Tykhiy.Os
3179458d0bSYaroslav Tykhiy.Sh NAME
3279458d0bSYaroslav Tykhiy.Nm vlan
3386e3186eSTom Rhodes.Nd "IEEE 802.1Q VLAN network interface"
3479458d0bSYaroslav Tykhiy.Sh SYNOPSIS
3586e3186eSTom RhodesTo compile support for the
3686e3186eSTom Rhodes.Nm
3786e3186eSTom Rhodesdriver into your kernel, place the following lines in your kernel configuration file:
3886e3186eSTom Rhodes.Bd -ragged -offset indent
3986e3186eSTom Rhodes.Cd "device miibus"
4086e3186eSTom Rhodes.Cd "device vlan"
4186e3186eSTom Rhodes.Ed
4286e3186eSTom Rhodes.Pp
4386e3186eSTom RhodesAlternatively, to load the
4486e3186eSTom Rhodes.Nm
4586e3186eSTom Rhodesdriver at boot time, place the following line in
4686e3186eSTom Rhodes.Xr loader.conf 5 :
4786e3186eSTom Rhodes.Bd -literal -offset indent
4886e3186eSTom Rhodesif_vlan_load="YES"
4986e3186eSTom Rhodes.Ed
5079458d0bSYaroslav Tykhiy.Sh DESCRIPTION
5179458d0bSYaroslav TykhiyThe
5279458d0bSYaroslav Tykhiy.Nm
5379458d0bSYaroslav Tykhiydriver demultiplexes frames tagged according to
5479458d0bSYaroslav Tykhiythe IEEE 802.1Q standard into logical
5579458d0bSYaroslav Tykhiy.Nm
5679458d0bSYaroslav Tykhiynetwork interfaces, which allows routing/bridging between
5779458d0bSYaroslav Tykhiymultiple VLANs through a single switch trunk port.
5879458d0bSYaroslav Tykhiy.Pp
590d35b35aSBrooks DavisEach
600d35b35aSBrooks Davis.Nm
610d35b35aSBrooks Davisinterface is created at runtime using interface cloning.
620d35b35aSBrooks DavisThis is
630d35b35aSBrooks Davismost easily done with the
640d35b35aSBrooks Davis.Xr ifconfig 8
650d35b35aSBrooks Davis.Cm create
660d35b35aSBrooks Daviscommand or using the
670d35b35aSBrooks Davis.Va cloned_interfaces
680d35b35aSBrooks Davisvariable in
690d35b35aSBrooks Davis.Xr rc.conf 5 .
700d35b35aSBrooks Davis.Pp
7179458d0bSYaroslav TykhiyTo function, a
7279458d0bSYaroslav Tykhiy.Nm
7379458d0bSYaroslav Tykhiyinterface must be assigned a parent interface and
7479458d0bSYaroslav Tykhiynumeric VLAN tag using
7579458d0bSYaroslav Tykhiy.Xr ifconfig 8 .
7679458d0bSYaroslav TykhiyA single parent can be assigned to multiple
7779458d0bSYaroslav Tykhiy.Nm
7879458d0bSYaroslav Tykhiyinterfaces provided they have different tags.
79c5f116aaSChristian BruefferThe parent interface is likely to be an Ethernet card connected
8079458d0bSYaroslav Tykhiyto a properly configured switch port.
8179458d0bSYaroslav TykhiyThe VLAN tag should match one of those set up in the switched
8279458d0bSYaroslav Tykhiynetwork.
83f41b145cSYaroslav Tykhiy.Sh HARDWARE
8479458d0bSYaroslav TykhiyThe
8579458d0bSYaroslav Tykhiy.Nm
86f41b145cSYaroslav Tykhiydriver supports efficient operation over parent interfaces that can provide
87f41b145cSYaroslav Tykhiyhelp in processing VLANs.
88f41b145cSYaroslav TykhiySuch interfaces are automatically recognized by their capabilities.
89f41b145cSYaroslav TykhiyDepending on the level of sophistication found in a physical
90f41b145cSYaroslav Tykhiyinterface, it may do full VLAN processing or just be able to
91f41b145cSYaroslav Tykhiyreceive and transmit frames exceeding the maximum Ethernet frame size
92f41b145cSYaroslav Tykhiyby the length of a 802.1Q header.
93f41b145cSYaroslav TykhiyThe capabilities may be user-controlled by the respective parameters to
94f41b145cSYaroslav Tykhiy.Xr ifconfig 8 ,
95f41b145cSYaroslav Tykhiy.Cm vlanhwtag
96f41b145cSYaroslav Tykhiyand
97f41b145cSYaroslav Tykhiy.Cm vlanmtu .
98f41b145cSYaroslav TykhiyHowever, a physical interface is not obliged to react to them:
99f41b145cSYaroslav TykhiyIt may have either capability enabled permanently without
100f41b145cSYaroslav Tykhiya way to turn it off.
101f41b145cSYaroslav TykhiyThe whole issue is very specific to a particular device and its driver.
102f41b145cSYaroslav Tykhiy.Pp
103f41b145cSYaroslav TykhiyBy now, the list of physical interfaces able of full VLAN processing
104f41b145cSYaroslav Tykhiyin the hardware is limited to the following devices:
1052ba5fff2SYaroslav Tykhiy.Xr bge 4 ,
106a5a8905cSYaroslav Tykhiy.Xr em 4 ,
107317bb722SYaroslav Tykhiy.Xr ixgb 4 ,
10879458d0bSYaroslav Tykhiy.Xr nge 4 ,
109d57916b1SYaroslav Tykhiy.Xr re 4 ,
11079458d0bSYaroslav Tykhiy.Xr ti 4 ,
111317bb722SYaroslav Tykhiy.Xr txp 4 ,
11279458d0bSYaroslav Tykhiyand
113317bb722SYaroslav Tykhiy.Xr vge 4 .
11479458d0bSYaroslav Tykhiy.Pp
115f41b145cSYaroslav TykhiyThe rest of the Ethernet interfaces can run
116dd4dc0a9SYaroslav TykhiyVLANs using software emulation in the
11779458d0bSYaroslav Tykhiy.Nm
11879458d0bSYaroslav Tykhiydriver.
11979458d0bSYaroslav TykhiyHowever, most of them lack the capability
120f41b145cSYaroslav Tykhiyof transmitting and receiving oversized frames.
121f41b145cSYaroslav TykhiyAssigning such an interface as the parent to
122f41b145cSYaroslav Tykhiy.Nm
123f41b145cSYaroslav Tykhiywill result in a reduced MTU on the corresponding
12479458d0bSYaroslav Tykhiy.Nm
12579458d0bSYaroslav Tykhiyinterfaces.
12679458d0bSYaroslav TykhiyIn the modern Internet, this is likely to cause
12779458d0bSYaroslav Tykhiy.Xr tcp 4
12879458d0bSYaroslav Tykhiyconnectivity problems due to massive, inadequate
12979458d0bSYaroslav Tykhiy.Xr icmp 4
13079458d0bSYaroslav Tykhiyfiltering that breaks the Path MTU Discovery mechanism.
13179458d0bSYaroslav Tykhiy.Pp
132f41b145cSYaroslav TykhiyThe interfaces that support oversized frames are as follows:
13372ddf849SRuslan Ermilov.Bl -tag -width ".Xr fxp 4 " -offset indent
134d57916b1SYaroslav Tykhiy.It Xr bfe 4
135d57916b1SYaroslav Tykhiysupports long frames for
136d57916b1SYaroslav Tykhiy.Nm
137d57916b1SYaroslav Tykhiynatively.
138db40c1aeSDoug Ambrisko.It Xr dc 4
139dd4dc0a9SYaroslav Tykhiysupports long frames for
140db40c1aeSDoug Ambrisko.Nm
141db40c1aeSDoug Ambriskonatively.
14279458d0bSYaroslav Tykhiy.It Xr de 4
14379458d0bSYaroslav Tykhiyrequires defining
14479458d0bSYaroslav Tykhiy.Dv BIG_PACKET
14579458d0bSYaroslav Tykhiyin the
14679458d0bSYaroslav Tykhiy.Pa /usr/src/sys/pci/if_de.c
14779458d0bSYaroslav Tykhiysource file and rebuilding the kernel
14879458d0bSYaroslav Tykhiyor module.
14979458d0bSYaroslav TykhiyThe hack works only for the 21041, 21140, and 21140A chips.
15079458d0bSYaroslav Tykhiy.It Xr fxp 4
151dd4dc0a9SYaroslav Tykhiysupports long frames for
15279458d0bSYaroslav Tykhiy.Nm
15379458d0bSYaroslav Tykhiynatively.
154469873caSJoerg Wunsch.It Xr hme 4
155469873caSJoerg Wunschsupports long frames for
156469873caSJoerg Wunsch.Nm
157469873caSJoerg Wunschnatively.
158d57916b1SYaroslav Tykhiy.It Xr rl 4
159d57916b1SYaroslav Tykhiysupports long frames for
160d57916b1SYaroslav Tykhiy.Nm
161d57916b1SYaroslav Tykhiynatively.
1628c992b7fSJohn Hay.It Xr sis 4
163dd4dc0a9SYaroslav Tykhiysupports long frames for
1648c992b7fSJohn Hay.Nm
1658c992b7fSJohn Haynatively.
166a5a8905cSYaroslav Tykhiy.It Xr ste 4
167dd4dc0a9SYaroslav Tykhiysupports long frames for
168a5a8905cSYaroslav Tykhiy.Nm
169a5a8905cSYaroslav Tykhiynatively.
17079458d0bSYaroslav Tykhiy.It Xr tl 4
171dd4dc0a9SYaroslav Tykhiyhas support for long frames.
17279458d0bSYaroslav Tykhiy.It Xr tx 4
173dd4dc0a9SYaroslav Tykhiysupports long frames for
174dd4dc0a9SYaroslav Tykhiy.Nm
175dd4dc0a9SYaroslav Tykhiynatively.
17679458d0bSYaroslav Tykhiy.It Xr xl 4
17779458d0bSYaroslav Tykhiysupports long frames only if the card is built on a newer chip
17872ddf849SRuslan Ermilov(Cyclone and above).
17979458d0bSYaroslav Tykhiy.El
18072ddf849SRuslan Ermilov.Pp
181a5eb8d53SSam LefflerThe
18279458d0bSYaroslav Tykhiy.Nm
183f41b145cSYaroslav Tykhiydriver automatically recognizes devices that natively support oversized frames
184a5eb8d53SSam Lefflerfor
18579458d0bSYaroslav Tykhiy.Nm
186a5eb8d53SSam Leffleruse and calculates the appropriate frame MTU based on the
187a5eb8d53SSam Lefflercapabilities of the parent interface.
188f41b145cSYaroslav TykhiyThe other interfaces listed above can handle oversized frames,
189f41b145cSYaroslav Tykhiybut they do not advertise this ability of theirs.
190f41b145cSYaroslav TykhiyThe MTU setting on
191f41b145cSYaroslav Tykhiy.Nm
192f41b145cSYaroslav Tykhiycan be corrected manually if used in conjunction with such parent interface.
19319e1bfc7SYaroslav Tykhiy.Sh SEE ALSO
19419e1bfc7SYaroslav Tykhiy.Xr kqueue 2 ,
19519e1bfc7SYaroslav Tykhiy.Xr miibus 4 ,
19619e1bfc7SYaroslav Tykhiy.Xr ifconfig 8
19779458d0bSYaroslav Tykhiy.Sh BUGS
19879458d0bSYaroslav TykhiyNo 802.1Q features except VLAN tagging are implemented.
199cb7d015eSYaroslav Tykhiy.Pp
200cb7d015eSYaroslav Tykhiy.Dv EVFILT_NETDEV
201cb7d015eSYaroslav Tykhiyevents on a
202cb7d015eSYaroslav Tykhiy.Nm
203cb7d015eSYaroslav Tykhiyinterface will be sent through
204cb7d015eSYaroslav Tykhiy.Xr kqueue 2
205cb7d015eSYaroslav Tykhiyonly if the parent interface uses
206cb7d015eSYaroslav Tykhiy.Xr miibus 4
207cb7d015eSYaroslav Tykhiyfor link state notification.
208