1-1
v1.0, June 2010
Chapter
1
Virtual LANs
In this chapter, the following examples are provided:
•
“Create Two VLANs” on page
1-2
•
“Assign Ports to VLAN2” on page
1-4
•
“Assign Ports to VLAN3” on page
1-5
•
“Assign VLAN3 as the Default VLAN for Port 1/0/2” on page
1-7
•
“Creating a MAC-based VLAN” on page
1-8
•
“Create a Protocol-Based VLAN” on page
1-12
•
“Virtual VLANs: Create an IP Subnet Based VLAN” on page
1-15
•
“Voice VLAN” on page
1-19
Adding Virtual LAN (VLAN) support to a Layer 2 switch offers some of the benefits of both bridging and
routing. Like a bridge, a VLAN switch forwards traffic based on the Layer 2 header, which is fast, and like a
router, it partitions the network into logical segments, which provides better administration, security and
management of multicast traffic.
A VLAN is a set of end stations and the switch ports that connect them. You can have different reasons for
the logical division, such as department or project membership. The only physical requirement is that the
end station and the port to which it is connected both belong to the same VLAN.
Each VLAN in a network has an associated VLAN ID, which appears in the IEEE 802.1Q tag in the Layer 2
header of packets transmitted on a VLAN. An end station may omit the tag, or the VLAN portion of the tag,
in which case the first switch port to receive the packet may either reject it or insert a tag using its default
VLAN ID. A given port may handle traffic for more than one VLAN, but it can only support one default
VLAN ID.
The Private Edge VLAN feature lets you set protection between ports located on the switch. This means that
a protected port cannot forward traffic to another protected port on the same switch. The feature does not
provide protection between ports located on different switches.
The diagram in this section shows a switch with four ports configured to handle the traffic for two VLANs.
port 1/0/2 handles traffic for both VLANs, while port 1/0/1 is a member of VLAN 2 only, and ports 1/0/3
and 1/0/4 are members of VLAN 3 only. The script following the diagram shows the commands you would