Skip to content
Website under migration: We are moving to a new design. Some pages may look different or load slowly for a few days. Thank you for your patience.
SwitchFirewall
IPv4 Detecting…
IPv6 Detecting…

Inter-VLAN Routing on Cisco: Router and Layer 3 Switch

Last updated:

Mastering InterVLAN Routing: A Comprehensive Guide

In today's interconnected world, network segmentation and efficient communication between different segments are crucial for security and performance. One of the essential techniques to achieve this is InterVLAN routing. This guide will explore when to use it, its benefits, how to enable it, and troubleshooting tips. By the end, you will have a clear understanding of this vital network concept.

When to Use InterVLAN Routing

InterVLAN routing is needed when devices in different VLANs (Virtual Local Area Networks) need to communicate. VLANs segment a network into smaller, more manageable sections, improving security and performance. Without routing, VLANs cannot communicate with each other.

Scenarios for InterVLAN Routing:

Benefits of InterVLAN Routing

How to Enable InterVLAN Routing

Configuring InterVLAN routing involves routers or Layer 3 switches. Follow these steps:

Step 1: Configure VLANs on the Switch

Create VLANs:

Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config)# vlan 20
Switch(config-vlan)# name Engineering

Assign Ports to VLANs:

Switch(config)# interface range fa0/1 - 12
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config)# interface range fa0/13 - 24
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 20

Step 2: Configure a Trunk Port

Set Up Trunking:

Switch(config)# interface fa0/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20

Step 3: Configure the Router or Layer 3 Switch

Router on a Stick (Sub-Interfaces):

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

Layer 3 Switch with SVI:

Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config)# interface vlan 20
Switch(config-if)# ip address 192.168.20.1 255.255.255.0
Switch(config-if)# no shutdown

Step 4: Configure Routing

Enable IP Routing:

Switch(config)# ip routing

Step 5: Test Connectivity

Ping Between VLANs: Test communication between devices in different VLANs to confirm routing works correctly.

Troubleshooting InterVLAN Routing

Conclusion

InterVLAN routing is a critical technique for network administrators, providing better security, performance, and manageability. It enables communication across segmented network portions and optimizes resource use. By following this guide, you can confidently configure and manage InterVLAN routing, troubleshoot effectively, and maintain a robust network environment.