How to Configure InterVLAN Routing

In the previous posts, we have covered the basics of VLANs and its configuration. VLANs are used to separate network traffic, enhance network security, and divide a large network into several small networks. We know that the systems belong to one VLAN cannot communicate to the systems belong to the other VLANs unless their VLAN name and VLAN ID do not match. However, there is a method called InterVLAN routing that allows different VLANs to communicate to each other. In order to allow InterVLAN communication, you need a layer 3 device such as a router or a layer 3 switch.

The dot1Q encapsulation is used for the InterVLAN communication. In this post, we will explain how to configure InterVLAN routing on Cisco routers and switches.

Configure InterVLAN Routing Step By Step

We will use the following topology to demonstrate how to configure InterVLAN routing.Configure InterVLAN Routing On Cisco Router

  1. On Switch1, execute the following commands to create a VLAN named Sales with the VLAN ID as 10.
Switch1(config)#vlan 10
Switch1(config-vlan)#name Sales
Switch1(config-vlan)#exit
  1. Once you have created Sales VLAN, execute the following commands to assign the Fa0/1 interface to Sales VLAN.
Switch1(config)#interface fa0/1
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#exit
  1. Next, execute the following commands to create another VLAN named Account with the VLAN ID as 20.
Switch1(config)#vlan 20
Switch1(config-vlan)#name Account
Switch1(config-vlan)#exit
  1. Next, execute the following commands to assign the Fa0/2 interface to Account VLAN.
Switch1(config)#interface fa0/2
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 20
Switch1(config-if)#exit
  1. Next, execute the following commands on Switch1 to enable VLAN trunking on the Fa0/3 interface.
Switch1(config)#interface fa0/3
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#exit
  1. After configuring VLANs and VLAN trunking on Switch1, configure the following TCP/IP settings on PC0:
  • IP address: 10.0.0.1
  • Subnet mask: 255.0.0.0
  • Default gateway: 10.0.0.100
  1. Next, configure the following TCP/IP settings on PC1.
  • IP address: 20.0.0.1
  • Subnet mask: 255.0.0.0
  • Default gateway: 20.0.0.100
  1. Once you have configured appropriate TCP/IP settings on PC0 and PC1, move on to Router. On Router, execute the following commands to bring the Fa0/0 interface up from the administratively down state.
Router(config)#interface fa0/0
Router(config-if)#no ip address
Router(config-if)#no shutdown
Router(config-if)#exit
  1. On Router, execute the following commands to enable the dot1Q encapsulation protocol (along with the VLAN ID) and to configure 10.0.0.100/8 IP address on its Fa0/0.10 sub-interface.
Router(config)#interface fa0/0.10
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 10.0.0.100 255.0.0.0
Router(config-subif)#exit
  1. On Router, execute the following commands to enable the dot1q encapsulation protocol (along with the VLAN ID) and to configure 20.0.0.100/8 IP address on its Fa0/0.20 sub-interface.
Router(config)#interface fa0/0.20
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 20.0.0.100 255.0.0.0
Router(config-subif)#exit
  1. Next, execute the following commands to configure the RIP routing (or any other depending on your choice) on Router.
Router(config)#router rip
Router(config-router)#network 10.0.0.0
Router(config-router)#network 20.0.0.0
Router(config)#exit

The following figure shows the InterVLAN routing configuration of Router. Configure InterVLAN Routing

  1. That’s all you need to configure InterVLAN routing. Now, it’s time to verify your configuration. To do so, open Command Prompt on PC1, and type the following commands to check the connectivity to PC0, as shown in the following figure.
PC>tracert 10.0.0.1
PC>ping 10.0.0.1

Verifiy InterVLAN Routing Configuration

  1. In the preceding figure, you can see that PC1 can communicate to PC0 successfully. However, both the PCs (PC0 and PC1) belong to different subnets (10.0.0.0/8 & 20.0.0.0/8) and VLANs (Sales & Account). This is what actually does InterVLAN routing.

In this post, we have explained the basics of InterVLAN routing and how to configure InterVLAN routing. Hope, it helped you. Please share it if you think it may help others too. You are always welcome to provide your valuable feedback.

Posted in Cisco, Switching Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*