VLAN provides Virtual Segmentation of Broadcast
Domain in the network. The devices, which are member of same Vlan, are able to
communicate with each other. The devices of different Vlan may communicate with each
other with routing. So that different Vlan devices will use different n/w addresses. Vlan provides
following advantages: -
(2) Enhance network security
Switch#vlan database
Switches will perform trunking with the help of
frame tagging. The trunk port will send data frames by adding a Vlan id information to
the frame, at the receiving end vlan id information is removing from the end and
according to the tag data is delivered to the corresponding vlan. There are two protocols to perform frame
tagging.
(1) Logical Segmentation of network
Creating port based Vlan
In port based Vlan, first we have to create a Vlan on
manageable switch then we have to add ports to the Vlan.
Commands to create Vlan
Switch#config ter
Switch(config)#vlan <no>
[name <word>]
Switch(config)#exit optional
Or
Switch(vlan)#vlan <no>
[name <word>]
Switch(vlan)#exit
Commands to configure ports for a Vlan
By default, all ports are member of single vlan that
is Vlan1. we can change vlan membership according to requirement.
Switch#conf ter
Switch(config)#interface <type> <no>
Switch(config-if)#switchport access vlan <no>
Switch(config-if)#exit
Commands to configure multiple ports in a vlan
Switch#conf ter
Switch(config)#interface range <type> <slot/port no
(space)–(space) port no>
Switch(config-if)#switchport access vlan <no>
Switch(config-if)#exit
Example: - Suppose we want to add interface fast
Ethernet 0/10 to 0/18 in vlan5
Switch#config ter
Switch(config)#interface range fastethernet 0/10 – 18
Switch(config-if)#switchport access vlan 5
Switchconfig-if#exit
In 1900 & Compatible switches
Switch#config ter
Switch(config)#interface <type> <no>
Switch(config-if)#vlan-membership static <vlan no>
Switch(config-if)#exit
To Disable web access in switch
Switch#config ter
Switch(config)#no ip http server
To display mac address table
Switch#sh mac-address-table
Vlan Mac address type ports
20 00-08-a16-ab-6a-7b
dynamic fa0/7
To Display Vlan and port membership
Switch#sh vlan
Trunking
When there are multiple switches then we have to use
trunk links to connect one switch with other. If we are not using trunk links then
we have to connect one cable from each vlan to the corresponding vlan of the other switch.
(1) Inter switch link (cisco prop)
(2) IEEE 802.1 q
Configuring Trunking
In cisco switches all
switch ports may be configured in three modes
(1) Trunk desirable (default)
(2) Trunk on
(3) Trunk off
Switch#conf ter
Switch(config)#interface <type> <no>
Switch(config-if)#switchport mode <trunk|access|auto>
Switch(config-if)#exit
To configure Vlans allowed on Trunk
By default all Vlans are allowed on Trunk port. We can
add/remove a partucular Vlan from trunk port with following command
Switch#config ter
Switch(config)#interface <type> <no>
Switch(config-if)#switchport trunk allowed vlan all
Remove <vlan>
Add <vlan>
Except <vlan>
To display trunk interfaces
Switch#sh interface trunk
Switch#sh interface <type> <no> trunk