Ad Code

Inter-VLAN Routing Using Router-on-a-Stick

Router-on-a-Stick topology showing VLANs connected through a single router interface.”


Introduction

In a network, VLANs (Virtual Local Area Networks) are used to divide a single switch into multiple logical networks. But computers in different VLANs cannot communicate directly. That’s where Inter-VLAN routing comes in. It allows devices from different VLANs to communicate securely through a router.

One of the most common and cost-effective methods for Inter-VLAN communication is called Router-on-a-Stick.


What is Router-on-a-Stick?

Router-on-a-Stick is a setup where a single physical router interface is used to route traffic between multiple VLANs.
Instead of using multiple physical interfaces, the router uses subinterfaces one for each VLAN.
Each subinterface acts like a separate connection to a VLAN, identified by a VLAN ID.

This setup is called Router-on-a-Stick because a single connection (the stick) between the switch and the router handles all VLAN traffic.


How It Works (Step-by-Step)

  1. Create VLANs on the switch (for example, VLAN 10 for Sales, VLAN 20 for HR, and VLAN 30 for IT).

  2. Assign ports on the switch to each VLAN.

  3. Configure a trunk link between the switch and the router so that multiple VLANs can share the same physical connection.

  4. Set up subinterfaces on the router one for each VLAN.

    • Example:

      • Gig0/0.10 for VLAN 10

      • Gig0/0.20 for VLAN 20

      • Gig0/0.30 for VLAN 30

  5. Assign IP addresses to each subinterface. These act as default gateways for devices in those VLANs.

  6. Enable routing, so the router can pass traffic between VLANs.

Once configured, users in VLAN 10 can talk to VLAN 20 or VLAN 30 through the router without needing separate cables or interfaces.


Router-on-a-Stick Configuration Example

Router Configuration:

Router(config)# interface gig0/0 Router(config-if)# no shutdown Router(config)# interface gig0/0.10 Router(config-subif)# encapsulation dot1Q 10 Router(config-subif)# ip address 192.168.10.1 255.255.255.0 Router(config)# interface gig0/0.20 Router(config-subif)# encapsulation dot1Q 20 Router(config-subif)# ip address 192.168.20.1 255.255.255.0 Router(config)# interface gig0/0.30 Router(config-subif)# encapsulation dot1Q 30 Router(config-subif)# ip address 192.168.30.1 255.255.255.0

Switch Configuration:

Switch(config)# vlan 10 Switch(config-vlan)# name Sales Switch(config)# vlan 20 Switch(config-vlan)# name HR Switch(config)# vlan 30 Switch(config-vlan)# name IT Switch(config)# interface gig0/1 Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk allowed vlan 10,20,30





Router subinterface configuration example for Inter-VLAN routing.”



Advantages of Router-on-a-Stick

  • Cost-effective  ] uses a single router interface.

  • Easy to configure and manage.

  • Ideal for small to medium-sized networks.


Limitations

  • Not suitable for heavy traffic networks since all VLAN data passes through one link.

  • Can become a bottleneck if too many VLANs or high data flow are involved.


Conclusion

Router-on-a-Stick is a simple and efficient way to enable communication between VLANs. It’s perfect for small networks or lab environments where cost and simplicity matter. Understanding this concept is also an essential step for anyone preparing for CCNA or networking certifications.


Post a Comment

0 Comments