Tuesday, January 3, 2012

VLAN on Cisco

On Switch
==========>

VLAN on Cisco Switch is quite easy.  We can set a particular port to an specific VLAN by using the following command:
switchport access vlan <vlan-id>
Further we can set a particular port as a trunk-port to carry multiple VLANs traffic using the following commands:
switchport mode trunk
switchport trunk allowed vlan 10,20,30 ==> do not use this command if you want to carry all VLANs traffic

On Router
=========>
Either you have to connect to the router through access-vlan port individually (i.e. from each vlan to Router's different port) or connect to the router through trunk port & create subinterface as follows.

int f0/0.1
encapsulation dot1q
ip address 192.168.10.1 255.255.255.0
no shut


int f0/0.2
encapsulation dot1q
ip address 192.168.20.1 255.255.255.0
no shut


int f0/0.3
encapsulation dot1q
ip address 192.168.30.1 255.255.255.0
no shut