How to Configure InterVLAN Routing on Cisco Layer 3 Switches

InterVLAN routing must be enabled in L3 Switch to communicate host in one VLAN with another VLAN. Cisco Layer 3 Catalyst switches having routing functionality which allows the switch to perform interVLAN routing. In this article I explain the InterVLan routing configuration in L3 Switch. This document uses a Cisco Catalyst 3550 switch and it can also be applied to other Layer 3 switches running Cisco IOS®

Step−by−Step Cisco L3 Switch Configuration:

1. We have to enable the routing on the switch using the ip routing command to perform interVLAN Routing and other Routing functionalists  Even if IP routing was previously enabled, this step ensures that it is indeed activated.

Switch(config)#ip routing

Note: If the switch does not accept the ip routing command, you need to upgrade to either SMI image 12.1(11)EA1 or later, or an EMI image, and repeat this step.

You can verify whether ip routing is enabled or not with the show running−configuration command, if enabled, it will appear on the top of the output.

Switch#sh run

hostname Switch
ip subnet−zero
ip routing
vtp domain Cisco
vtp mode transparent

2. Make note of all the VLANs that you want to route between. In our example, we want to route traffic between VLANs 2, 3 and 5.

3. Use the show vlan command to verify that the VLANs exist in the VLAN database. If they do not exist, you must add them on the switch.

You can add VLANs from VLAN database mode or from configuration mode but latest Cisco IOS Switches having only configuration mode option.

From Database Mode:

Switch#vlan database
Switch(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
Switch(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
Switch(vlan)#vlan 5
VLAN 10 added:
Name: VLAN005
APPLY completed.

From Configuration Mode:

Swtich(config)#vlan 2
Switch(config)#name IT

Swtich(config)#vlan 3
Switch(config)#name  Sales

Swtich(config)#vlan 3
Switch(config)#name Marketing

3. Determine the IP addresses you want to assign to the VLAN interface on the switch. For the switch to be able to route between the VLANs, the VLAN interfaces must be configured with an IP address. When the switch receives a packet destined for another subnet/VLAN, the switch looks at the routing table to determine where to forward the packet. The packet is then passed to the VLAN interface of the destination and in turn it is sent to the port where the end device is attached.

4. Configure the VLAN interfaces with the IP address

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface Vlan2
Switch(config−if)#ip address
Switch(config−if)#no shutdown

Repeat the procedure for all VLANs as above.

5. Assign required number of switch ports to particular VLANs.

Switch(config)#interface FastEthernet 0/1
Switch(config−if)#deception ##VLAN 2##
Switch(config−if)#switchport mode access
Switch(config−if)#switchport access vlan 2
Switch(config−if)#no shutdown

Repeat the procedure for all VLANs as above.

6. Configure the interface to the default router for other end. We can covert the switch port from L2 to L3 capable using no switchport command.  Now we can configure IP address on interface directly.

Switch(config)#interface FastEthernet 0/1
Switch(config−if)#no switchport
Switch(config−if)#ip address
Switch(config−if)#no shutdown

7. Now Configure the default route for the switch

Switch(config)#ip route

Note that IP address of the default router is If the switch receives a packet for a network which is not in the routing table, it forwards it to the default gateway for further processing.

Note: The ip default−gateway command is used to specify the default gateway when routing is not enabled. However, in this case, routing is enabled (from Step 1) hence the ip default−gateway command is unnecessary.

8. Configure your end devices to use the respective Catalyst 3550 VLAN interface as their default-Gateway. For example, devices in VLAN 2 should use the interface VLAN 2 IP address as its default gateway. Refer to the appropriate client configuration guide for more information on designating the default gateway.

Verify Cisco L3 Switch Configuration:

You can use below show commands to confirm your configuration is working properly.

  1. show ip route – You can find all directly connected networks in routing table with code C.
  2. show ip interface brief – Lists a brief summary of an interface’s IP information and status. This command can be used to verify interface & protocol status of VLAN interfaces and ports on switch.

Filed Under: VLAN/VTP


About the Author:

RSSComments (1)

Leave a Reply | Trackback URL

  1. Adam says:

    I liked your article about Intervlan Routing on Cisco L3 switches.
    thanks to google I found you

Leave a Reply

If you want a picture to show with your comment, go get a Gravatar.