Layer 2 VLAN Configuration On A Cisco Switc2
Layer 2 VLAN Configuration On A Cisco Switc2
Layer 2 VLAN Configuration On A Cisco Switc2
This post will deal with creating Layer 2 VLANs on Cisco switches and
performing all relevant configurations.
The need to configure several Layer 2 VLANs on a switch arises from the
need to segment an internal Local Area Network (LAN) into different IP
subnetworks.
By separating the internal LAN into different IP subnets (and thus different
VLANs) allows the network administrators to enforce traffic restrictions if
needed between departments and have better control of internal hosts.
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 the switches.
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 Switch 2.
SWITCH 1:
Fe0/1 – Fe0/2 –> VLAN 2 (Accounting)
Fe0/10 – Fe0/11 –> VLAN 4 (Engineering)
Fe0/24 –> Trunk Port
SWITCH 2:
Fe0/1 – Fe0/2 –> VLAN 3 (Management)
Fe0/10 – Fe0/11 –> VLAN 4 (Engineering)
Fe0/24 –> Trunk Port
Switch 1 Configuration:
! Create VLANs 2 and 4 in the switch database
Switch1# configure terminal
Switch1(config)# vlan 2
Switch1(config-vlan)# name Accounting
Switch1(config-vlan)# end
Switch1(config)# vlan 4
Switch1(config-vlan)# name Engineering
Switch1(config-vlan)# end
Switch2(config)# vlan 4
Switch2(config-vlan)# name Engineering
Switch2(config-vlan)# end
Verification
If you want to verify that the physical interfaces are assigned properly to
each VLAN, then run the following show commands:
SWITCH1#show vlan
SWITCH2#show vlan
Now, after separating the network into different VLANs, this means that we
have created separate broadcast domains (one for each VLAN) and now
hosts within the same VLAN can freely communicate between them
(provided they belong also in the same Layer 3 subnet).
On the other hand, hosts that belong in different Layer 2 VLANs can’t
communicate between them. e.g hosts in VLAN 3 are not allowed to
communicate with hosts in VLAN 4.
Related Posts