Why Router On Stick Had Been So Popular Till Now?

Inter VLAN Routing

 A router or a layer-3 device is required to allow communication between different VLANs. This capability of routing between VLANs is called Inert-VLAN routing. Once a host is separated through the VLAN, member hosts of the same VLAN can communicate with each other.


The process of connecting one physical link with the trunk logical (sub) interface is known Router-on-stick. Consider the following scenario: We have 2 VLANs with two different networks or sub-networks (the router sub-interface is connected to each VLAN, so it is better to have a different network for each VLAN).

We have to enable trunk encapsulation (dot1q) under sub-interface. The hosts in each VLAN will use the sub-interface configured for their VLAN as their default gateway. Earlier, 4 VLANs required 4 physical links from routers to switches in order to route between VLANs. Presently, in Cisco devices, we can create any number of sub-interfaces (logical) with just one physical link, based on the number of VLAN in our network, each for one VLAN.


In the above scenario, we took two PC’s, a switch and a router. In the above scenario PC’s, we have given two different network IP address i.e. and Then create 2 virtual LAN in the switch and connect the PC’s in the two different VLAN, as we know that two PC’s of different VLAN cannot communicate with each other for this, we connect a router with this switch to communicate between the two different VLAN PC’s.  

Creating VLAN’s as name HR and Sales

Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# vlan 2
Switch(config-vlan)# name HR
Switch(config-vlan)# vlan 3
Switch(config-vlan)# name Sales
Configuration of VLAN’s for the particular switch port
Switch(config-vlan)# interface fa0/2
Switch(config-if)# switchport access vlan 2
Switch(config-if)# switchport mode access
Switch(config-if)# interface fa0/3
Switch(config-if)# switchport access vlan 3
Switch(config-if)# switchport mode access
Configuration of Trunk port for connecting with the router
Switch(config-if)# interface fa0/1
Switch(config-if)# switchport mode trunk
Configuration of dot1Q Trunk in Router Interface
Router> enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface fastEthernet 0/0
Router(config-if)# no shut down
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
Router(config-if)# exit
outer(config)# interface fastEthernet 0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
Router(config-subif)# encapsulation dot1Q 2
Router(config-subif)# ip address
Router(config-subif)# exit
Router(config)# interface fastethernet 0/0.3
%LINK-5-CHANGED: Interface FastEthernet0/0.3, changed state to up
Router(config-subif)# encapsulation dot1Q 3
Router(config-subif)# ip address
The sub-interface (FastEthernet 0/0.2) number and VLAN ID do not have to match exactly. It is only a common practice to make VLAN ID and sub-interface numbers the same. The sub-interface number is only locally significant, and it does not matter which are the sub-interface number that is configured on the router.

Now verify the configuration to check whether we have routing between VLAN 2 and VLAN 3

Verification of Routing

As you observe, a response from is received which had a successful inter-vlan routing between VLAN 2 and VLAN 3. This is located in VLAN 3

Also read,

1. Three Steps to Configure VLAN Properly
2.  What is VLAN and How It is Work and It’s Benefits
3. Access Port Vs Trunk Port

Leave a Reply

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