VLAN(4) FreeBSD Kernel Interfaces Manual VLAN(4)
NAME
vlan, svlan - IEEE 802.1Q and 802.1ad pseudo-device
SYNOPSIS
pseudo-device vlan
DESCRIPTION
The vlan driver provides network interfaces supporting Virtual Local Area
Networks (VLANs) on Ethernet networks. vlan interfaces implement virtual
networks using the IEEE 802.1Q protocol. svlan interfaces implement
virtual networks using the IEEE 802.1ad protocol.
svlan interfaces allow construction of IEEE 802.1ad-compliant provider
bridges. vlan and svlan interfaces can be configured to provide QinQ or
stacked VLANs.
The interfaces can be created at runtime using the ifconfig vlanN create
command or by setting up a hostname.if(5) configuration file for
netstart(8). The interface itself can be configured with ifconfig(8);
see its manual page for more information.
vlan and svlan interfaces must be configured with a parent Ethernet
interface to operate, and a virtual network identifier. Packets
transmitted through a vlan or svlan interface will be encapsulated in
their respective protocols and transmitted on the specified physical
interface. 802.1Q and 802.1ad packets received on the parent interface
will be matched to the vlan and svlan interfaces by their respective
protocol and virtual network identifiers, and decapsulated for reception
on the associated virtual interfaces.
The 802.1Q and 802.1ad protocols include a priority field. By default,
the 802.1p priority in a transmitted packet is based on the priority of
packets sent over the interface, which may be altered via pf.conf(5); see
the prio option for more information. Alternatively, txprio can set a
specific priority for transmitted packets.
vlan and svlan interfaces support the following ioctl(2)s:
SIOCSIFPARENT struct if_parent *
Set the parent interface. The parent may only be configured
while the virtual interface is administratively down.
SIOCGIFPARENT struct if_parent *
Get the currently configured parent interface.
SIOCDIFPARENT struct ifreq *
Delete the parent interface configuration. The parent may
only be removed while the virtual interface is
administratively down.
SIOCSVNETID struct ifreq *
Set the virtual network identifier. Valid identifiers are in
the range 1 to 4094.
SIOCGVNETID struct ifreq *
Get the currently configured virtual network identifier.
SIOCDVNETID struct ifreq *
Clear the current virtual network identifier. Virtual
interfaces without a configured virtual network identifier
will use 0 in their protocols tag field.
SIOCSIFLLADDR struct ifreq *
Configure a custom MAC address on the virtual interface. When
the virtual interface is using a custom MAC address, the
parent interface will be configured to promiscuously receive
packets. When operating without a custom MAC address, the
virtual interface will inherit the parent interfaces MAC
address. Configuring 00:00:00:00:00:00 as the MAC address
will clear the custom MAC address configuration and resume
operation with the parents MAC address.
vlan and svlan interfaces use the following capability on parent
interfaces:
IFCAP_VLAN_MTU The parent interface can handle full sized
frames, plus the size of the vlan tag.
vlan interfaces use the following capability on parent interfaces:
IFCAP_VLAN_HWTAGGING The parent interface will offload the
encapsulation and decapsulation of 802.1Q
frames.
EXAMPLES
Create an 802.1Q virtual interface on top of the physical interface em0,
with virtual network identifier 5:
# ifconfig vlan0 create
# ifconfig vlan0 parent em0 vnetid 5
# ifconfig vlan0 10.1.1.100/24
Create an 802.1Q VLAN interface on network 10, on top of an 802.1ad
provider bridge on network 8, on top of the physical interface bge0:
# ifconfig svlan0 create
# ifconfig svlan0 parent bge0 vnetid 8
# ifconfig svlan0 up
# ifconfig vlan0 create
# ifconfig vlan0 parent svlan0 vnetid 10
# ifconfig vlan0 10.1.1.101/24
Configure an 802.1Q VLAN interface with a custom MAC address:
# ifconfig vlan0 lladdr fe:e1:ba:d0:84:0e
Remove a custom MAC address from an 802.1Q VLAN interface:
# ifconfig vlan0 lladdr 00:00:00:00:00:00
Force the use of priority 1 for transmitted packets, regardless of the
packet priority:
# ifconfig vlan0 txprio 1
SEE ALSO
inet(4), ip(4), netintro(4), hostname.if(5), pf.conf(5), ifconfig(8),
netstart(8)
IEEE 802.1Q standard,
https://standards.ieee.org/standard/802_1Q-2018.html.
IEEE 802.1ad standard, Provider Bridges, QinQ.
AUTHORS
Originally Garrett Wollman <
[email protected]>.
CAVEATS
Some Ethernet chips will either discard or truncate Ethernet frames that
are larger than 1514 bytes. This causes a problem as 802.1Q and 802.1ad
tagged frames can be up to 1518 bytes. Most controller chips can be told
not to discard large frames and/or to increase the allowed frame size.
FreeBSD 14.1-RELEASE-p8 September 12, 2022 FreeBSD 14.1-RELEASE-p8