xref: /freebsd/share/man/man4/vlan.4 (revision 23af96ad2220b409b64d3d8e32869c294eee1272)
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*23af96adSMarius Strobl.Dd December 26, 2020
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,
3600a58aedSWarren Blockplace the following line 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 Tykhiy.Nm
83161172e5SWarren Blockinitially assumes the same minimum length for tagged and untagged frames.
84161172e5SWarren BlockThis mode is selected by setting the
856572700eSYaroslav Tykhiy.Xr sysctl 8
86f6e5e0adSYaroslav Tykhiyvariable
87f6e5e0adSYaroslav Tykhiy.Va net.link.vlan.soft_pad
88161172e5SWarren Blockto 0
89161172e5SWarren Block.Pq default .
90161172e5SWarren BlockHowever, there are network devices that fail to adjust frame length
91161172e5SWarren Blockwhen it falls 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
100161172e5SWarren Blockso that their length is 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 ,
114161172e5SWarren Block.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
12200a58aedSWarren BlockAt present, these devices are capable of full VLAN processing
12300a58aedSWarren Blockin hardware:
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 ,
1304e400768SDavid Christensen.Xr bxe 4 ,
131ae34b8fcSYaroslav Tykhiy.Xr cxgb 4 ,
13254e4ee71SNavdeep Parhar.Xr cxgbe 4 ,
133a5a8905cSYaroslav Tykhiy.Xr em 4 ,
1341f253c5dSPyun YongHyeon.Xr igb 4 ,
1351f253c5dSPyun YongHyeon.Xr ixgbe 4 ,
136629bf506SPyun YongHyeon.Xr jme 4 ,
137f173c2b7SSean Bruno.Xr liquidio 4 ,
1381f95590dSPyun YongHyeon.Xr msk 4 ,
1391f253c5dSPyun YongHyeon.Xr mxge 4 ,
14079458d0bSYaroslav Tykhiy.Xr nge 4 ,
141d57916b1SYaroslav Tykhiy.Xr re 4 ,
14253ac9f49SPyun YongHyeon.Xr sge 4 ,
14397fe1b09SPyun YongHyeon.Xr stge 4 ,
14479458d0bSYaroslav Tykhiy.Xr ti 4 ,
14579458d0bSYaroslav Tykhiyand
146317bb722SYaroslav Tykhiy.Xr vge 4 .
14779458d0bSYaroslav Tykhiy.Pp
148161172e5SWarren BlockOther Ethernet interfaces can run VLANs using software emulation in the
14979458d0bSYaroslav Tykhiy.Nm
15079458d0bSYaroslav Tykhiydriver.
151161172e5SWarren BlockHowever, some lack the capability
15268721affSYaroslav Tykhiyof transmitting and receiving long frames.
153f41b145cSYaroslav TykhiyAssigning such an interface as the parent to
154f41b145cSYaroslav Tykhiy.Nm
155f41b145cSYaroslav Tykhiywill result in a reduced MTU on the corresponding
15679458d0bSYaroslav Tykhiy.Nm
15779458d0bSYaroslav Tykhiyinterfaces.
15879458d0bSYaroslav TykhiyIn the modern Internet, this is likely to cause
15979458d0bSYaroslav Tykhiy.Xr tcp 4
16079458d0bSYaroslav Tykhiyconnectivity problems due to massive, inadequate
16179458d0bSYaroslav Tykhiy.Xr icmp 4
16279458d0bSYaroslav Tykhiyfiltering that breaks the Path MTU Discovery mechanism.
16379458d0bSYaroslav Tykhiy.Pp
164161172e5SWarren BlockThese interfaces natively support long frames for
165161172e5SWarren Block.Nm :
166bc96a575SPyun YongHyeon.Xr axe 4 ,
16766d204f8SYaroslav Tykhiy.Xr bfe 4 ,
1687cd038bcSMarius Strobl.Xr cas 4 ,
16966d204f8SYaroslav Tykhiy.Xr dc 4 ,
1701f253c5dSPyun YongHyeon.Xr et 4 ,
171ae34b8fcSYaroslav Tykhiy.Xr fwe 4 ,
17266d204f8SYaroslav Tykhiy.Xr fxp 4 ,
17366d204f8SYaroslav Tykhiy.Xr gem 4 ,
17466d204f8SYaroslav Tykhiy.Xr le 4 ,
175ae34b8fcSYaroslav Tykhiy.Xr nfe 4 ,
17666d204f8SYaroslav Tykhiy.Xr rl 4 ,
17766d204f8SYaroslav Tykhiy.Xr sis 4 ,
17866d204f8SYaroslav Tykhiy.Xr sk 4 ,
17966d204f8SYaroslav Tykhiy.Xr ste 4 ,
18066d204f8SYaroslav Tykhiy.Xr vr 4 ,
181bb0667afSPyun YongHyeon.Xr vte 4 ,
18266d204f8SYaroslav Tykhiyand
18366d204f8SYaroslav Tykhiy.Xr xl 4 .
18472ddf849SRuslan Ermilov.Pp
185a5eb8d53SSam LefflerThe
18679458d0bSYaroslav Tykhiy.Nm
18768721affSYaroslav Tykhiydriver automatically recognizes devices that natively support long frames
188a5eb8d53SSam Lefflerfor
18979458d0bSYaroslav Tykhiy.Nm
190a5eb8d53SSam Leffleruse and calculates the appropriate frame MTU based on the
191a5eb8d53SSam Lefflercapabilities of the parent interface.
19268721affSYaroslav TykhiySome other interfaces not listed above may handle long frames,
19300a58aedSWarren Blockbut they do not advertise this ability.
194f41b145cSYaroslav TykhiyThe MTU setting on
195f41b145cSYaroslav Tykhiy.Nm
19666d204f8SYaroslav Tykhiycan be corrected manually if used in conjunction with such a parent interface.
19719e1bfc7SYaroslav Tykhiy.Sh SEE ALSO
198f6e5e0adSYaroslav Tykhiy.Xr ifconfig 8 ,
199f6e5e0adSYaroslav Tykhiy.Xr sysctl 8
200