Enabling InterVLAN Connectivity: A Beginner's Guide

This beginner's guide explains how to enable communication between different VLANs using InterVLAN routing methods like router-on-a-stick and Switch Virtual Interfaces (SVIs). Includes practical configuration examples and troubleshooting steps.

Enabling InterVLAN Connectivity: A Beginner's Guide

When you first learn about VLANs, you quickly discover they create separate broadcast domains that can't communicate with each other by default. This isolation is great for security and network segmentation, but what happens when devices in different VLANs need to talk? That's where InterVLAN connectivity comes in.

Think of VLANs like separate apartments in a building. Without a hallway connecting them, residents can't visit each other. InterVLAN routing provides that hallway, enabling controlled communication between VLANs.

Why VLANs Can't Communicate by Default

VLANs operate at Layer 2 of the OSI model, creating separate broadcast domains. Devices in VLAN 10 can only communicate directly with other devices in VLAN 10. To communicate with devices in VLAN 20, traffic must travel up to Layer 3 (the network layer) where routing decisions are made.

This is actually a feature, not a bug. It provides security by preventing unauthorized access between network segments and reduces broadcast traffic by keeping it contained within each VLAN.

Methods for Enabling InterVLAN Connectivity

Router-on-a-Stick

The most common method for CCNA-level networking is router-on-a-stick. This approach uses a single physical interface on a router, divided into multiple logical subinterfaces—one for each VLAN.

Here's how to configure it on a Cisco router:

Router(config)# interface gigabitethernet 0/0
Router(config-if)# no shutdown

Router(config)# interface gigabitethernet 0/0.10
Router(config-subif)# encapsulation dot1q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0

Router(config)# interface gigabitethernet 0/0.20
Router(config-subif)# encapsulation dot1q 20
Router(config-subif)# ip address 192.168.20.1 255.255.255.0

The encapsulation dot1q command tells the router which VLAN tags to process on each subinterface. The physical interface connecting to the switch must be configured as a trunk to carry multiple VLANs.

Switch Virtual Interfaces (SVIs)

Layer 3 switches can perform InterVLAN routing using Switch Virtual Interfaces. This method is more efficient than router-on-a-stick because routing happens within the switch hardware.

Switch(config)# ip routing
Switch(config)# vlan 10
Switch(config)# vlan 20

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

The ip routing command enables routing functionality on the switch, transforming it from a Layer 2 device into a Layer 3 device.

Configuring the Switch Side

Regardless of your InterVLAN routing method, the switch configuration remains similar. You need to create VLANs and assign ports appropriately:

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

Switch(config)# interface fastethernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

Switch(config)# interface fastethernet 0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20

Switch(config)# interface gigabitethernet 0/1
Switch(config-if)# switchport mode trunk

Testing InterVLAN Connectivity

After configuration, test connectivity using ping between devices in different VLANs. If a device in VLAN 10 (192.168.10.5) can successfully ping a device in VLAN 20 (192.168.20.5), your InterVLAN routing is working.

Use show ip route on your router or Layer 3 switch to verify that routes exist for all VLAN subnets. You should see directly connected routes for each VLAN interface.

Common Troubleshooting Steps

If InterVLAN communication isn't working, check these items systematically:

  • Verify VLAN creation and port assignments with show vlan brief
  • Confirm trunk configuration with show interfaces trunk
  • Check IP addressing on VLAN interfaces
  • Ensure devices have correct default gateway settings
  • Verify routing table entries with show ip route

What's Next

Now that you understand basic InterVLAN connectivity, the next logical step is exploring VLAN Trunking Protocol (VTP) for managing VLAN information across multiple switches. We'll also dive deeper into trunk configuration and troubleshooting common VLAN issues in upcoming posts.

🔧
Use network simulation software like Packet Tracer or GNS3 to practice these InterVLAN configurations without needing physical equipment. Cisco Packet Tracer, GNS3 and EVE-NG.

Tools and resources for this topic