6. Inter-VLAN Routing Configuration (Layer 3 Switch + Router-on-a-Stick)

πŸš€ Inter-VLAN Routing Configuration (Layer 3 Switch + Router-on-a-Stick)

Contents hide
1 πŸš€ Inter-VLAN Routing Configuration (Layer 3 Switch + Router-on-a-Stick)

πŸ”₯ Introduction (Real Problem You Might Face)

You created VLANs perfectly… but:

  • ❌ HR cannot access Sales server
  • ❌ IT team cannot manage other VLANs
  • ❌ Ping fails between departments

πŸ‘‰ Devices in different VLANs cannot communicate.

πŸ‘‰ Everything looks correctβ€”but communication is blocked.

For example:

  • HR (VLAN 10) cannot ping IT (VLAN 20)

πŸ‘‰ This is expected behavior β€” VLANs are isolated by design.

But in real-world networks:

  • Departments need to share resources
  • Applications must communicate
  • Servers must be accessible

πŸ‘‰ Without proper routing, your network becomes partially unusable.

Root Cause:
VLANs isolate traffic at Layer 2. Without routing, they are completely separate networks.

βœ”οΈ Solution: This is where Inter-VLAN Routing becomes essential.


⚑ Inter-VLAN Routing (Quick Answer)

Inter-VLAN Routing allows communication between different VLANs using a Router or a Layer 3 switch.

Inter-Vlan Routing

 


🧠 What is Inter-VLAN Routing?

Inter-VLAN Routing is the process of enabling communication between VLANs using a Layer 3 device.

πŸ‘‰ It solves the problem of VLAN isolation by:

  1. Allowing controlled communication
  2. Connecting multiple VLAN networks
  3. Enabling real-world applications

Simple Understanding:

  • VLAN = separate network
  • Router/L3 Switch = connects networks

πŸ‘‰ πŸ’‘ Key Insight:
Without Inter-VLAN Routing, VLANs remain isolated and Devices in different VLANs cannot exchange data.


πŸ”„ Why Inter-VLAN Routing is Needed ?

Without routing:

  • VLAN 10 β†’ isolated
  • VLAN 20 β†’ isolated

πŸ‘‰ With routing:

βœ” Devices communicate
βœ” Applications work
βœ” Network becomes functional


🏒 Real-World Network Scenario

VLANDepartmentNetwork
VLAN 10HR192.168.10.0/24
VLAN 20Sales192.168.20.0/24
VLAN 30IT192.168.30.0/24

πŸ‘‰ Requirement:

  • All departments should communicate securely
  • Maintain VLAN isolation + controlled access

πŸ› οΈ Methods of Inter-VLAN Routing

There are two main methods:

  1. Router-on-a-Stick
  2. Layer 3 Switch Routing

πŸ› οΈ Method 1: Router-on-a-Stick Configuration

πŸ“Œ What is Router-on-a-Stick?

πŸ‘‰ A single physical router interface is divided into multiple subinterfaces. It uses trunk link (802.1Q tagging).

πŸ‘‰ Best for: Small networks / budget setups and labs

πŸ‘‰ Each subinterface represents a VLAN


βš™οΈ Configuration (Cisco)

πŸ”Ή Switch Configuration

enable
configure terminal

vlan 10
name HR

vlan 20
name SALES

interface fastethernet 0/1
switchport mode access
switchport access vlan 10

interface fastethernet 0/2
switchport mode access
switchport access vlan 20

interface gigabitethernet 0/1
switchport mode trunk

πŸ”Ή Router Configuration

enable
configure terminal

interface gigabitethernet 0/0
no shutdown

interface gigabitethernet 0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0

interface gigabitethernet 0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0

πŸ”„ Packet Flow (VERY IMPORTANT πŸ”₯)

πŸ‘‰ Example: VLAN 10 β†’ VLAN 20

  • PC1 sends packet β†’ Switch (untagged)
  • Switch adds VLAN tag β†’ sends via trunk
  • Router receives β†’ identifies VLAN 10
  • Router routes to VLAN 20
  • Sends back via same interface
  • Switch forwards to PC2

⚠️ Important:
All traffic goes through ONE router interface β†’ possible bottleneck


⚠️ Limitations

  • ❌ Single point of failure
  • ❌ Bandwidth bottleneck
  • ❌ Not scalable

 


πŸ› οΈ Method 2: Layer 3 Switch (SVI Routing)

πŸ“Œ What is Layer 3 Switching?

πŸ‘‰ Layer 3 switch

  • Performs routing inside switch hardware
  • Uses SVI (Switched Virtual Interface)
  • Does not require any external router

πŸ‘‰ Best for: Medium to large networks

πŸ‘‰ Switch acts as both switch and router


βš™οΈ Configuration (Cisco)

enable
configure terminal

ip routing

vlan 10
name HR

vlan 20
name SALES

interface vlan 10
ip address 192.168.10.1 255.255.255.0
no shutdown

interface vlan 20
ip address 192.168.20.1 255.255.255.0
no shutdown

interface fastethernet 0/1
switchport mode access
switchport access vlan 10

interface fastethernet 0/2
switchport mode access
switchport access vlan 20

πŸ”„ Packet Flow (High-Speed Routing ⚑)

  • PC sends packet β†’ switch
  • Switch routes internally
  • No external device involved
  • Packet delivered instantly

πŸ‘‰ Result: Ultra-fast communication


βš–οΈ Difference between Router-on-a-Stick vs Layer 3 Switch

Here below is a detailed comparison between Router on a stick and Layer 3 Switch.

βš™οΈ Feature🟑 Router-on-a-Stick🟒 Layer 3 Switch
πŸ’° CostLow (Budget Friendly)Higher (Enterprise)
⚑ PerformanceModerate (CPU-based routing)High (Hardware ASIC routing)
πŸ“ˆ ScalabilityLimitedExcellent
⏱️ LatencyHigherVery Low
πŸ”Œ Interface UsageSingle Interface (Trunk)Multiple SVIs (Virtual Interfaces)
🧠 ComplexityMediumEasy
πŸ“Š Traffic HandlingBottleneck RiskHandles High Traffic Easily
🏒 Best Use CaseSmall Networks / LabsEnterprise Networks
πŸš€ SpeedSlowerUltra Fast

 

πŸ‘‰ β€œFor production networks, Layer 3 switch is always recommended due to performance and scalability.”


🌍 Real-World Use Cases

🏒 Office Network

  • Department isolation
  • Controlled communication

🏫 Educational Institutes

  • Student vs Admin VLAN separation

🏭 Data Centers

  • Server segmentation
  • High-speed routing

☁️ Enterprises

  • Secure multi-department architecture

🎯 When to Use Which Method?

πŸ‘‰ Use Router-on-a-Stick when:

  • Network is small
  • Budget is limited
  • Learning or lab setup

πŸ‘‰ Use Layer 3 Switch when:

  • Network is large
  • High performance required
  • Multiple VLANs exist

πŸ‘‰ πŸ’‘ Key Insight:
Layer 3 switches are preferred in modern networks due to speed and scalability.


🧯 Troubleshooting Inter-VLAN Routing

If inter VLAN routing is not working, check:

πŸ” VLAN Status

show vlan brief

πŸ” Check trunk status

show interfaces trunk

πŸ” Interface Status

show ip interface brief

πŸ” Trunk Configuration

show interfaces trunk

πŸ” Check routing table

show ip route

πŸ” Check VLAN configuration

show vlan brief

πŸ‘‰ πŸ’‘ Pro Tip:
Always verify VLAN, trunk, and IP addressing before debugging routing issues.


⚠️ Common Mistakes to Avoid

  • ❌ Missing ip routing (L3 switch) – Layer 3 switch will not route
  • ❌ Wrong VLAN assignment
  • ❌ Trunk not configured – VLAN traffic will not reach router
  • ❌ Incorrect default gateway on PCs
  • ❌ Subinterface encapsulation missing
  • ❌ Wrong IP addressing – Devices will not communicate

πŸ’‘ Pro Tips (Real Admin Insights)

  • βœ… Always use Layer 3 switch in production
  • βœ… Use Router-on-a-Stick only for labs
  • βœ… Plan VLAN IP scheme before deployment
  • βœ… Monitor traffic to avoid congestion
  • βœ… Keep VLAN design simple

πŸ”— Related Topics (Recommended Reading)

➑️ What is VLAN

➑️ VLAN Configuration

➑️ VLAN Tagging (802.1Q) Explained

➑️ VLAN Troubleshooting Steps

➑️ VLAN Security Best Practices

➑️ You can also refer to Inter-VLAN Routing Configuration – Explained by networklessons


🎯 Interview Questions

  1. What is Inter-VLAN Routing?
  2. What is Router-on-a-Stick?
  3. Difference between Layer 2 and Layer 3 switch?

❓ FAQs

1. Why devices in different VLANs cannot communicate?

πŸ‘‰ Because VLANs are isolated at Layer 2.


2. Which method should I use?

πŸ‘‰ Based on the size and budget. So if ,

  • Small setup β†’ Router-on-a-Stick
  • Enterprise β†’ Layer 3 switch (better performance)

3. What is SVI?

πŸ‘‰ Virtual interface acting as gateway for VLAN.


4. Can both methods be used together?

πŸ‘‰ Yes

  • L3 switch β†’ internal routing
  • Router β†’ internet access

5. What is default gateway in VLAN?

  • Router subinterface IP address OR
  • SVI interface IP address

🎯 Conclusion

Inter-VLAN Routing is essential for enabling communication between VLANs.

πŸ‘‰ It helps:

  • Connect networks
  • Enable applications
  • Improve network functionality

πŸ‘‰ Without it, VLANs remain isolated and unusable in real-world environments.

πŸ‘‰ Key takeaway:

  • Router-on-a-Stick β†’ Simple, budget-friendly
  • Layer 3 Switch β†’ Fast, scalable, professional

 

Leave a Comment