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.
在 FreeBSD 上,要使用 VLANs 必須有網路卡驅動程式的支援,要查看那些驅動程式支援 vlan,請參考 vlan(4) 操作手冊。
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
NIC of em0
and a
VLAN tag of 5
. The
command would look like this:
#
ifconfig em0.5
create vlan 5
vlandev em0
inet 192.168.20.20/24
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
added:
vlans_em0
="5
"
ifconfig_em0
_5
="inet 192.168.20.20/24"
Additional VLANs may be added, by simply
adding the tag to the
vlans_
field and adding an additional line configuring the network on
that VLAN tag's interface.em0
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。