The need to configure several Layer 2 VLANs on a switch arises from the need to segment an internal LocalArea Network (LAN) into different IP subnetworks. If you want for example to separate the different departments of your enterprise into different IP subnetworks, then each department should belong toits own Layer 2 VLAN. For example, let’s assume the following scenario:
* Accounting Department: IP Subnet 192.168.2.0/24 –> VLAN 2
* Management Department: IP Subnet 192.168.3.0/24 –>VLAN 3
* Engineering Department: IP Subnet 192.168.4.0/24 –> VLAN 4
By separating the internal LAN into different IP subnets (and thus different VLANs) allows the network administrators toenforce traffic restrictions if needed between departments and have better control of internal hosts.
VLAN assignment on a switch is configured on a per-interface basis. That is, each switch port interfaceis assigned individually into a Layer 2 VLAN. If you have more than one switch connected and you want the same VLANs to belong across all switches, then a Trunk Port must be configured between theswitches. The Trunk Port passes all VLANs between the switches. Let’s see the following network scenario to help us clarify some concepts.
On the LAN network above, we have three VLANs. VLAN 2,3, and 4.VLAN 4 belongs both to SWITCH 1 and SWITCH 2, therefore we need a Trunk Port between the two switches in order for hosts in VLAN4 in Switch 1 to be able to communicate with hosts in VLAN4 in Switch2.
The ports of the two switches shall be configured as following:
SWITCH 1: name Engineering
Fe0/1 – Fe0/2 –> VLAN 2 (Accounting)
Fe0/10 – Fe0/11 –> VLAN 4 (Engineering)
Fe0/24 –> Trunk...