VLANs are a way of virtually dividing up a network into many different subnetworks. Each will have its own broadcast domain and be isolated from the rest of the VLANs.
On FreeBSD, VLANs must be supported by the network card driver. To see which drivers support vlans, refer to the vlan(4) manual page.
When configuring a VLAN, a couple pieces of information must be known. First, which network interface? Second, what is the VLAN tag?
To configure VLANs at run time, with a
em0 and a
VLAN tag of
command would look like this:
See how the interface name includes the NIC driver name and the VLAN tag, separated by a period? This is a best practice to make maintaining the VLAN configuration easy when many VLANs are present on a machine.
To configure VLANs at boot time,
/etc/rc.conf must be updated. To duplicate
the configuration above, the following will need to be
Additional VLANs may be added, by simply
adding the tag to the
field and adding an additional line configuring the network on
that VLAN tag's interface.