Monday, October 26, 2009

VLAN Configuration on Layer 3 Switch

How to configure a Cisco Layer 3 switch for VLAN Routing:

================================

Step 1. Let us enable IP Routing

Switch(config)#ip routing

Do you know?: The about command gives Routing function to the Switch. If the switch is not accepting this command, then you have to upgrade the operating system of your switch (The operating system is generally called as IOS or Image in cisco parlance.)

================================

Step 2: Add VLAN 2,3,4


Switch#vlan database
Switch(vlan)#vlan 10

Switch(vlan)#vlan 20

Switch(vlan)#vlan 30

Do you know?: VLAN 1 is default vlan and it exists already.You cannot delete it also.

============================================================

Step 3: These three vlans to be configured in all the switches. If VTP is there, then if configured in one, the database will be transmitted to all other switches.

for VTP configuration,refer my first tutorial

=============================================================
Step 4: Each VLAN should have a unique IP address. Then only computers of one vlan can communicate with the computers of other vlans. In otherwords, vlan to vlan communication is through Layer 3. Layer 3 means you need an ip address.


Switch(config)#interface Vlan10
Switch(config-if)#ip address 10.10.10.1.1 255.255.255.0
Switch(config-if)#no shutdown

Switch(config)#interface Vlan20
Switch(config-if)#ip address 20.20.20.1 255.255.255.0
Switch(config-if)#no shutdown

Switch(config)#interface Vlan30
Switch(config-if)#ip address 30.30.30.1 255.255.255.0
Switch(config-if)#no shutdown

 

=============================================

 

Step 5: Imagine the switch as a virtual router (because, it is a layer 3 switch). Then this virtual router is to be connected to the next Real Router. For this purpose, let us convert a switch port into router interface.

Switch(config)#interface FastEthernet 0/1
Switch(config-if)#no switchport
Switch(config-if)#ip address 40.40.40.1 255.255.255.0
================================================

Let us configure the routing table for this virtual router (ie this layer3 switch):

Switch(config)#ip route 0.0.0.0 0.0.0.0 40.40.40.2

Now try to ping 40.40.40.2 from any of the PCs in any of the VLANs

==============================================

 

No comments:

Post a Comment