xref: /freebsd/share/man/man4/vlan.4 (revision 1f253c5de4b0da003df27ef7c9723ee52c946aa6)
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.\"
28*1f253c5dSPyun YongHyeon.Dd December 19, 2010
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
3516d78bb8STom RhodesTo compile this driver into the kernel,
3616d78bb8STom Rhodesplace the following lines in your
3790296834STom Rhodeskernel configuration file:
3886e3186eSTom Rhodes.Bd -ragged -offset indent
3986e3186eSTom Rhodes.Cd "device vlan"
4086e3186eSTom Rhodes.Ed
4186e3186eSTom Rhodes.Pp
4216d78bb8STom RhodesAlternatively, to load the driver as a
4316d78bb8STom Rhodesmodule at boot time, place the following line in
4486e3186eSTom Rhodes.Xr loader.conf 5 :
4586e3186eSTom Rhodes.Bd -literal -offset indent
4686e3186eSTom Rhodesif_vlan_load="YES"
4786e3186eSTom Rhodes.Ed
4879458d0bSYaroslav Tykhiy.Sh DESCRIPTION
4979458d0bSYaroslav TykhiyThe
5079458d0bSYaroslav Tykhiy.Nm
5179458d0bSYaroslav Tykhiydriver demultiplexes frames tagged according to
5279458d0bSYaroslav Tykhiythe IEEE 802.1Q standard into logical
5379458d0bSYaroslav Tykhiy.Nm
5479458d0bSYaroslav Tykhiynetwork interfaces, which allows routing/bridging between
5579458d0bSYaroslav Tykhiymultiple VLANs through a single switch trunk port.
5679458d0bSYaroslav Tykhiy.Pp
570d35b35aSBrooks DavisEach
580d35b35aSBrooks Davis.Nm
590d35b35aSBrooks Davisinterface is created at runtime using interface cloning.
600d35b35aSBrooks DavisThis is
610d35b35aSBrooks Davismost easily done with the
620d35b35aSBrooks Davis.Xr ifconfig 8
630d35b35aSBrooks Davis.Cm create
640d35b35aSBrooks Daviscommand or using the
650d35b35aSBrooks Davis.Va cloned_interfaces
660d35b35aSBrooks Davisvariable in
670d35b35aSBrooks Davis.Xr rc.conf 5 .
680d35b35aSBrooks Davis.Pp
6979458d0bSYaroslav TykhiyTo function, a
7079458d0bSYaroslav Tykhiy.Nm
7179458d0bSYaroslav Tykhiyinterface must be assigned a parent interface and
7279458d0bSYaroslav Tykhiynumeric VLAN tag using
7379458d0bSYaroslav Tykhiy.Xr ifconfig 8 .
7479458d0bSYaroslav TykhiyA single parent can be assigned to multiple
7579458d0bSYaroslav Tykhiy.Nm
7679458d0bSYaroslav Tykhiyinterfaces provided they have different tags.
77c5f116aaSChristian BruefferThe parent interface is likely to be an Ethernet card connected
7879458d0bSYaroslav Tykhiyto a properly configured switch port.
7979458d0bSYaroslav TykhiyThe VLAN tag should match one of those set up in the switched
8079458d0bSYaroslav Tykhiynetwork.
81f6e5e0adSYaroslav Tykhiy.Pp
82f6e5e0adSYaroslav TykhiyInitially
83f6e5e0adSYaroslav Tykhiy.Nm
84f6e5e0adSYaroslav Tykhiyassumes the same minimum length for tagged and untagged frames.
85f6e5e0adSYaroslav TykhiyThis mode is selected by the
866572700eSYaroslav Tykhiy.Xr sysctl 8
87f6e5e0adSYaroslav Tykhiyvariable
88f6e5e0adSYaroslav Tykhiy.Va net.link.vlan.soft_pad
89f6e5e0adSYaroslav Tykhiyset to 0 (default).
90f6e5e0adSYaroslav TykhiyHowever, there are network devices that fail to adjust frame length,
91f6e5e0adSYaroslav Tykhiyshould it fall below the allowed minimum due to untagging.
92f6e5e0adSYaroslav TykhiySuch devices should be able to interoperate with
93f6e5e0adSYaroslav Tykhiy.Nm
94f6e5e0adSYaroslav Tykhiyafter changing the value of
95f6e5e0adSYaroslav Tykhiy.Va net.link.vlan.soft_pad
96f6e5e0adSYaroslav Tykhiyto 1.
97f6e5e0adSYaroslav TykhiyIn the latter mode,
98f6e5e0adSYaroslav Tykhiy.Nm
99f6e5e0adSYaroslav Tykhiywill pad short frames before tagging them
100f6e5e0adSYaroslav Tykhiyso that their length stays not less than the minimum value
101f6e5e0adSYaroslav Tykhiyafter untagging by the non-compliant devices.
102f41b145cSYaroslav Tykhiy.Sh HARDWARE
10379458d0bSYaroslav TykhiyThe
10479458d0bSYaroslav Tykhiy.Nm
105f41b145cSYaroslav Tykhiydriver supports efficient operation over parent interfaces that can provide
106f41b145cSYaroslav Tykhiyhelp in processing VLANs.
107f41b145cSYaroslav TykhiySuch interfaces are automatically recognized by their capabilities.
108f41b145cSYaroslav TykhiyDepending on the level of sophistication found in a physical
109f41b145cSYaroslav Tykhiyinterface, it may do full VLAN processing or just be able to
11068721affSYaroslav Tykhiyreceive and transmit long frames (up to 1522 bytes including an Ethernet
11168721affSYaroslav Tykhiyheader and FCS).
112f41b145cSYaroslav TykhiyThe capabilities may be user-controlled by the respective parameters to
113f41b145cSYaroslav Tykhiy.Xr ifconfig 8 ,
114f41b145cSYaroslav Tykhiy.Cm vlanhwtag
115f41b145cSYaroslav Tykhiyand
116f41b145cSYaroslav Tykhiy.Cm vlanmtu .
117f41b145cSYaroslav TykhiyHowever, a physical interface is not obliged to react to them:
118f41b145cSYaroslav TykhiyIt may have either capability enabled permanently without
119f41b145cSYaroslav Tykhiya way to turn it off.
120f41b145cSYaroslav TykhiyThe whole issue is very specific to a particular device and its driver.
121f41b145cSYaroslav Tykhiy.Pp
122f41b145cSYaroslav TykhiyBy now, the list of physical interfaces able of full VLAN processing
123f41b145cSYaroslav Tykhiyin the hardware is limited to the following devices:
124f7a029ebSStanislav Sedov.Xr ae 4 ,
1257a0bde84SPyun YongHyeon.Xr age 4 ,
126ff24f054SPyun YongHyeon.Xr alc 4 ,
127cad7d367SPyun YongHyeon.Xr ale 4 ,
128ae34b8fcSYaroslav Tykhiy.Xr bce 4 ,
1292ba5fff2SYaroslav Tykhiy.Xr bge 4 ,
130ae34b8fcSYaroslav Tykhiy.Xr cxgb 4 ,
131a5a8905cSYaroslav Tykhiy.Xr em 4 ,
132*1f253c5dSPyun YongHyeon.Xr igb 4 ,
133317bb722SYaroslav Tykhiy.Xr ixgb 4 ,
134*1f253c5dSPyun YongHyeon.Xr ixgbe 4 ,
135629bf506SPyun YongHyeon.Xr jme 4 ,
1361f95590dSPyun YongHyeon.Xr msk 4 ,
137*1f253c5dSPyun YongHyeon.Xr mxge 4 ,
138*1f253c5dSPyun YongHyeon.Xr nxge 4 ,
13979458d0bSYaroslav Tykhiy.Xr nge 4 ,
140d57916b1SYaroslav Tykhiy.Xr re 4 ,
14153ac9f49SPyun YongHyeon.Xr sge 4 ,
14297fe1b09SPyun YongHyeon.Xr stge 4 ,
14379458d0bSYaroslav Tykhiy.Xr ti 4 ,
144317bb722SYaroslav Tykhiy.Xr txp 4 ,
14579458d0bSYaroslav Tykhiyand
146317bb722SYaroslav Tykhiy.Xr vge 4 .
14779458d0bSYaroslav Tykhiy.Pp
148f41b145cSYaroslav TykhiyThe rest of the Ethernet interfaces can run
149dd4dc0a9SYaroslav TykhiyVLANs using software emulation in the
15079458d0bSYaroslav Tykhiy.Nm
15179458d0bSYaroslav Tykhiydriver.
152677f6a78SYaroslav TykhiyHowever, some of them lack the capability
15368721affSYaroslav Tykhiyof transmitting and receiving long frames.
154f41b145cSYaroslav TykhiyAssigning such an interface as the parent to
155f41b145cSYaroslav Tykhiy.Nm
156f41b145cSYaroslav Tykhiywill result in a reduced MTU on the corresponding
15779458d0bSYaroslav Tykhiy.Nm
15879458d0bSYaroslav Tykhiyinterfaces.
15979458d0bSYaroslav TykhiyIn the modern Internet, this is likely to cause
16079458d0bSYaroslav Tykhiy.Xr tcp 4
16179458d0bSYaroslav Tykhiyconnectivity problems due to massive, inadequate
16279458d0bSYaroslav Tykhiy.Xr icmp 4
16379458d0bSYaroslav Tykhiyfiltering that breaks the Path MTU Discovery mechanism.
16479458d0bSYaroslav Tykhiy.Pp
16566d204f8SYaroslav TykhiyThe following interfaces support long frames for
166d57916b1SYaroslav Tykhiy.Nm
16766d204f8SYaroslav Tykhiynatively:
16866d204f8SYaroslav Tykhiy.Xr bfe 4 ,
1697cd038bcSMarius Strobl.Xr cas 4 ,
17066d204f8SYaroslav Tykhiy.Xr dc 4 ,
171*1f253c5dSPyun YongHyeon.Xr et 4 ,
172ae34b8fcSYaroslav Tykhiy.Xr fwe 4 ,
17366d204f8SYaroslav Tykhiy.Xr fxp 4 ,
174*1f253c5dSPyun YongHyeon.Xr fwe 4 ,
17566d204f8SYaroslav Tykhiy.Xr gem 4 ,
17666d204f8SYaroslav Tykhiy.Xr hme 4 ,
17766d204f8SYaroslav Tykhiy.Xr le 4 ,
178ae34b8fcSYaroslav Tykhiy.Xr nfe 4 ,
17943ff6aecSYaroslav Tykhiy.Xr nve 4 ,
18066d204f8SYaroslav Tykhiy.Xr rl 4 ,
1818454ccedSPyun YongHyeon.Xr sf 4 ,
18266d204f8SYaroslav Tykhiy.Xr sis 4 ,
18366d204f8SYaroslav Tykhiy.Xr sk 4 ,
18466d204f8SYaroslav Tykhiy.Xr ste 4 ,
185ac95c078SYaroslav Tykhiy.Xr tl 4 ,
18666d204f8SYaroslav Tykhiy.Xr tx 4 ,
18766d204f8SYaroslav Tykhiy.Xr vr 4 ,
18866d204f8SYaroslav Tykhiyand
18966d204f8SYaroslav Tykhiy.Xr xl 4 .
19072ddf849SRuslan Ermilov.Pp
191a5eb8d53SSam LefflerThe
19279458d0bSYaroslav Tykhiy.Nm
19368721affSYaroslav Tykhiydriver automatically recognizes devices that natively support long frames
194a5eb8d53SSam Lefflerfor
19579458d0bSYaroslav Tykhiy.Nm
196a5eb8d53SSam Leffleruse and calculates the appropriate frame MTU based on the
197a5eb8d53SSam Lefflercapabilities of the parent interface.
19868721affSYaroslav TykhiySome other interfaces not listed above may handle long frames,
199f41b145cSYaroslav Tykhiybut they do not advertise this ability of theirs.
200f41b145cSYaroslav TykhiyThe MTU setting on
201f41b145cSYaroslav Tykhiy.Nm
20266d204f8SYaroslav Tykhiycan be corrected manually if used in conjunction with such a parent interface.
20319e1bfc7SYaroslav Tykhiy.Sh SEE ALSO
204f6e5e0adSYaroslav Tykhiy.Xr ifconfig 8 ,
205f6e5e0adSYaroslav Tykhiy.Xr sysctl 8
20679458d0bSYaroslav Tykhiy.Sh BUGS
20779458d0bSYaroslav TykhiyNo 802.1Q features except VLAN tagging are implemented.
208