Wednesday, September 15, 2010

commands related to VLAN

All the commands related to VLAN

Common
tasks on all Switches:
Give HostName to the switch
Switch(config)#hostname SW1
--------------------------------
Disable DNS lookup

SW1(config)#no ip domain-lookup
------------------------------------
Configure enable secret password

SW1(config)#enable secret norah
--------------------------------------
Configure the default gateway
SW1(config)#ip default-gateway 192.168.99.1
------------------------------------------
Configure a password to the console port

SW1(config)#line console 0

SW1(config-line)#password cisco
-----------------------------------------
Configure password to the vty ports

SW1(config-line)#login

SW1(config-line)#line vty 0 15

SW1(config-line)#password cisco

SW1(config-line)#login

SW1(config-line)#end
---------------------------------



Find out the existing VLANs in the Switch.
SW1#show vlan

VLAN Name Status Ports
- -- - - - - - --
1 default active Fa0/1, Fa0/2,
Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15,Fa0/16

Fa0/17, Fa0/18, Fa0/19,Fa0/20

Fa0/21, Fa0/22, Fa0/23,Fa0/24

Gig1/1, Gig1/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active



Let
us shut down all the ports


SW1(config)#interface range fa0/1-24

SW1(config-if-range)#shutdown

SW1(config-if-range)#interface range gi0/1-2

SW1(config-if-range)#shutdown

Save the Configuration

SW1#copy running-config startup-config

VTP configuration Procedure:

When you have more than one Switch, you can form a group. This is VTP.
When forming a group, one of them will be the Server and
others will be clients

Consider we have 3 Switches SW1,SW2,SW3. Let us configure SW1
as server, SW2,SW3 as clients
Let us put the vtp domain name as 'brain' and vtp password
as 'drain'

SW1 is the VTP server; SW2 and SW3 are VTP clients.



SW1(config)#vtp mode server



SW1(config)#vtp domain brain



SW1(config)#vtp password drain

--------------------------------

SW2(config)#vtp mode client



SW2(config)#vtp domain brain



SW2(config)#vtp password drain
-------------------------------



Configure the Trunk ports
SW1(config)#interface range fa0/1-5

SW1(config-if-range)#switchport mode trunk
configure one of the vlan as Native vlan:

SW1(config-if-range)#switchport trunk native vlan 99
Make the ports active:

SW1(config-if-range)#no shutdown



SW1(config)#vlan 10

SW1(config-vlan)#name teachers

SW1(config-vlan)#vlan 20

SW1(config-vlan)#name students



SW1(config-vlan)#vlan 99

SW1(config-vlan)#name admin

Now check the SW2,SW3. You will find that bove configuration
is automatically done by the server.



SW2#show vlan brief

VLAN Name Status Ports

----------------------------

1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5

Fa0/6, Fa0/7, Fa0/8, Fa0/9

Fa0/10, Fa0/11, Fa0/12,Fa0/13

Fa0/14, Fa0/15, Fa0/16,Fa0/17

Fa0/18, Fa0/19, Fa0/20,Fa0/21

Fa0/22, Fa0/23, Fa0/24, Gi0/1

Gi0/2

10 teachers active

20 students active

99 admin active



Configure unique ip address for each switch::

SW1(config)#interface vlan99

SW1(config-if)#ip address 192.168.99.11 255.255.255.0

SW1(config-if)#no shutdown

SW2(config)#interface vlan99

SW2(config-if)#ip address 192.168.99.12 255.255.255.0

SW2(config-if)#no shutdown

SW3(config)#interface vlan99

SW3(config-if)#ip address 192.168.99.13 255.255.255.0

SW3(config-if)#no shutdown
Test the connectivity between switches by ping.



Now configure the access ports

SW2(config)#interface range fa0/5-10

SW2(config-if-range)#switchport access vlan 30

SW2(config-if-range)#interface range fa0/11-17

SW2(config-if-range)#switchport access vlan 10

SW2(config-if-range)#interface range fa0/18-24

SW2(config-if-range)#switchport access vlan 20

Configuration of Router:

If there are four ethernet port at the router, you can extend for cables
one for each vlan.

But let us configure by vlan trunking method:

R1(config)#interface fastethernet 0/1

R1(config-if)#no shutdown


R1(config-if)#interface fastethernet 0/1.1

R1(config-subif)#encapsulation dot1q 1

R1(config-subif)#ip address 192.168.1.1 255.255.255.0


R1(config-subif)#interface fastethernet 0/1.10

R1(config-subif)#encapsulation dot1q 10

R1(config-subif)#ip address 192.168.10.1 255.255.255.0


R1(config-subif)#interface fastethernet 0/1.20

R1(config-subif)#encapsulation dot1q 20

R1(config-subif)#ip address 192.168.20.1 255.255.255.0

R1(config-subif)#interface fastethernet 0/1.99

R1(config-subif)#encapsulation dot1q 99 native

R1(config-subif)#ip address 192.168.99.1 255.255.255.0


note: vlan99 is made as native vlan. otherwise vlan1 will be the native
vlan by default.

Configure the webserver end

R1(config)#interface FastEthernet0/0

R1(config-if)#ip address 192.168.50.1 255.255.255.0

R1(config-if)#no shutdown

No comments:

Post a Comment