2001-07-28 12:27:06 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2001 Yar Tikhiy
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2006-01-31 22:41:59 +00:00
|
|
|
.Dd January 30, 2006
|
2001-07-28 12:27:06 +00:00
|
|
|
.Dt VLAN 4
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm vlan
|
2005-07-19 00:26:30 +00:00
|
|
|
.Nd "IEEE 802.1Q VLAN network interface"
|
2001-07-28 12:27:06 +00:00
|
|
|
.Sh SYNOPSIS
|
2005-10-07 02:32:16 +00:00
|
|
|
To compile this driver into the kernel,
|
|
|
|
place the following lines in your
|
2005-07-21 05:02:39 +00:00
|
|
|
kernel configuration file:
|
2005-07-19 00:26:30 +00:00
|
|
|
.Bd -ragged -offset indent
|
|
|
|
.Cd "device miibus"
|
|
|
|
.Cd "device vlan"
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2005-10-07 02:32:16 +00:00
|
|
|
Alternatively, to load the driver as a
|
|
|
|
module at boot time, place the following line in
|
2005-07-19 00:26:30 +00:00
|
|
|
.Xr loader.conf 5 :
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
if_vlan_load="YES"
|
|
|
|
.Ed
|
2001-07-28 12:27:06 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver demultiplexes frames tagged according to
|
|
|
|
the IEEE 802.1Q standard into logical
|
|
|
|
.Nm
|
|
|
|
network interfaces, which allows routing/bridging between
|
|
|
|
multiple VLANs through a single switch trunk port.
|
|
|
|
.Pp
|
2002-05-29 06:55:06 +00:00
|
|
|
Each
|
|
|
|
.Nm
|
|
|
|
interface is created at runtime using interface cloning.
|
|
|
|
This is
|
|
|
|
most easily done with the
|
|
|
|
.Xr ifconfig 8
|
|
|
|
.Cm create
|
|
|
|
command or using the
|
|
|
|
.Va cloned_interfaces
|
|
|
|
variable in
|
|
|
|
.Xr rc.conf 5 .
|
|
|
|
.Pp
|
2001-07-28 12:27:06 +00:00
|
|
|
To function, a
|
|
|
|
.Nm
|
|
|
|
interface must be assigned a parent interface and
|
|
|
|
numeric VLAN tag using
|
|
|
|
.Xr ifconfig 8 .
|
|
|
|
A single parent can be assigned to multiple
|
|
|
|
.Nm
|
|
|
|
interfaces provided they have different tags.
|
2004-12-21 01:09:34 +00:00
|
|
|
The parent interface is likely to be an Ethernet card connected
|
2001-07-28 12:27:06 +00:00
|
|
|
to a properly configured switch port.
|
|
|
|
The VLAN tag should match one of those set up in the switched
|
|
|
|
network.
|
2005-01-30 12:06:02 +00:00
|
|
|
.Sh HARDWARE
|
2001-07-28 12:27:06 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2005-01-30 12:06:02 +00:00
|
|
|
driver supports efficient operation over parent interfaces that can provide
|
|
|
|
help in processing VLANs.
|
|
|
|
Such interfaces are automatically recognized by their capabilities.
|
|
|
|
Depending on the level of sophistication found in a physical
|
|
|
|
interface, it may do full VLAN processing or just be able to
|
|
|
|
receive and transmit frames exceeding the maximum Ethernet frame size
|
|
|
|
by the length of a 802.1Q header.
|
|
|
|
The capabilities may be user-controlled by the respective parameters to
|
|
|
|
.Xr ifconfig 8 ,
|
|
|
|
.Cm vlanhwtag
|
|
|
|
and
|
|
|
|
.Cm vlanmtu .
|
|
|
|
However, a physical interface is not obliged to react to them:
|
|
|
|
It may have either capability enabled permanently without
|
|
|
|
a way to turn it off.
|
|
|
|
The whole issue is very specific to a particular device and its driver.
|
|
|
|
.Pp
|
|
|
|
By now, the list of physical interfaces able of full VLAN processing
|
|
|
|
in the hardware is limited to the following devices:
|
2001-10-05 06:30:42 +00:00
|
|
|
.Xr bge 4 ,
|
2002-08-27 14:01:14 +00:00
|
|
|
.Xr em 4 ,
|
2005-01-30 10:59:50 +00:00
|
|
|
.Xr ixgb 4 ,
|
2001-07-28 12:27:06 +00:00
|
|
|
.Xr nge 4 ,
|
2004-05-26 11:34:51 +00:00
|
|
|
.Xr re 4 ,
|
2001-07-28 12:27:06 +00:00
|
|
|
.Xr ti 4 ,
|
2005-01-30 10:59:50 +00:00
|
|
|
.Xr txp 4 ,
|
2001-07-28 12:27:06 +00:00
|
|
|
and
|
2005-01-30 10:59:50 +00:00
|
|
|
.Xr vge 4 .
|
2001-07-28 12:27:06 +00:00
|
|
|
.Pp
|
2005-01-30 12:06:02 +00:00
|
|
|
The rest of the Ethernet interfaces can run
|
2002-08-27 14:26:05 +00:00
|
|
|
VLANs using software emulation in the
|
2001-07-28 12:27:06 +00:00
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
However, most of them lack the capability
|
2005-01-30 12:06:02 +00:00
|
|
|
of transmitting and receiving oversized frames.
|
|
|
|
Assigning such an interface as the parent to
|
|
|
|
.Nm
|
|
|
|
will result in a reduced MTU on the corresponding
|
2001-07-28 12:27:06 +00:00
|
|
|
.Nm
|
|
|
|
interfaces.
|
|
|
|
In the modern Internet, this is likely to cause
|
|
|
|
.Xr tcp 4
|
|
|
|
connectivity problems due to massive, inadequate
|
|
|
|
.Xr icmp 4
|
|
|
|
filtering that breaks the Path MTU Discovery mechanism.
|
|
|
|
.Pp
|
2005-01-30 12:06:02 +00:00
|
|
|
The interfaces that support oversized frames are as follows:
|
2001-08-08 10:27:25 +00:00
|
|
|
.Bl -tag -width ".Xr fxp 4 " -offset indent
|
2004-05-26 11:34:51 +00:00
|
|
|
.It Xr bfe 4
|
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2002-01-16 16:33:58 +00:00
|
|
|
.It Xr dc 4
|
2002-08-27 14:26:05 +00:00
|
|
|
supports long frames for
|
2002-01-16 16:33:58 +00:00
|
|
|
.Nm
|
|
|
|
natively.
|
2001-07-28 12:27:06 +00:00
|
|
|
.It Xr de 4
|
|
|
|
requires defining
|
|
|
|
.Dv BIG_PACKET
|
|
|
|
in the
|
|
|
|
.Pa /usr/src/sys/pci/if_de.c
|
|
|
|
source file and rebuilding the kernel
|
|
|
|
or module.
|
|
|
|
The hack works only for the 21041, 21140, and 21140A chips.
|
|
|
|
.It Xr fxp 4
|
2002-08-27 14:26:05 +00:00
|
|
|
supports long frames for
|
2001-07-28 12:27:06 +00:00
|
|
|
.Nm
|
|
|
|
natively.
|
2005-08-28 15:08:57 +00:00
|
|
|
.It Xr gem 4
|
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2004-05-06 13:38:53 +00:00
|
|
|
.It Xr hme 4
|
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2006-01-31 22:41:59 +00:00
|
|
|
.It Xr le 4
|
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2004-05-26 11:34:51 +00:00
|
|
|
.It Xr rl 4
|
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2001-12-05 09:34:49 +00:00
|
|
|
.It Xr sis 4
|
2002-08-27 14:26:05 +00:00
|
|
|
supports long frames for
|
2001-12-05 09:34:49 +00:00
|
|
|
.Nm
|
|
|
|
natively.
|
2005-10-11 22:59:01 +00:00
|
|
|
.It Xr sk 4
|
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2002-08-27 14:01:14 +00:00
|
|
|
.It Xr ste 4
|
2002-08-27 14:26:05 +00:00
|
|
|
supports long frames for
|
2002-08-27 14:01:14 +00:00
|
|
|
.Nm
|
|
|
|
natively.
|
2001-07-28 12:27:06 +00:00
|
|
|
.It Xr tl 4
|
2002-08-27 14:26:05 +00:00
|
|
|
has support for long frames.
|
2001-07-28 12:27:06 +00:00
|
|
|
.It Xr tx 4
|
2002-08-27 14:26:05 +00:00
|
|
|
supports long frames for
|
|
|
|
.Nm
|
|
|
|
natively.
|
2001-07-28 12:27:06 +00:00
|
|
|
.It Xr xl 4
|
|
|
|
supports long frames only if the card is built on a newer chip
|
2001-08-08 10:27:25 +00:00
|
|
|
(Cyclone and above).
|
2001-07-28 12:27:06 +00:00
|
|
|
.El
|
2001-08-08 10:27:25 +00:00
|
|
|
.Pp
|
2002-11-15 00:25:33 +00:00
|
|
|
The
|
2001-07-28 12:27:06 +00:00
|
|
|
.Nm
|
2005-01-30 12:06:02 +00:00
|
|
|
driver automatically recognizes devices that natively support oversized frames
|
2002-11-15 00:25:33 +00:00
|
|
|
for
|
2001-07-28 12:27:06 +00:00
|
|
|
.Nm
|
2002-11-15 00:25:33 +00:00
|
|
|
use and calculates the appropriate frame MTU based on the
|
|
|
|
capabilities of the parent interface.
|
2005-01-30 12:06:02 +00:00
|
|
|
The other interfaces listed above can handle oversized frames,
|
|
|
|
but they do not advertise this ability of theirs.
|
|
|
|
The MTU setting on
|
|
|
|
.Nm
|
|
|
|
can be corrected manually if used in conjunction with such parent interface.
|
2004-11-15 16:38:37 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr kqueue 2 ,
|
|
|
|
.Xr miibus 4 ,
|
|
|
|
.Xr ifconfig 8
|
2004-11-15 14:33:17 +00:00
|
|
|
.Sh BUGS
|
|
|
|
No 802.1Q features except VLAN tagging are implemented.
|
|
|
|
.Pp
|
|
|
|
.Dv EVFILT_NETDEV
|
|
|
|
events on a
|
|
|
|
.Nm
|
|
|
|
interface will be sent through
|
|
|
|
.Xr kqueue 2
|
|
|
|
only if the parent interface uses
|
|
|
|
.Xr miibus 4
|
|
|
|
for link state notification.
|