Hands-On Lab: Configuring and Allowing Inter-VLAN Routing — SVI

This hands-on lab configures inter-VLAN routing using Switch Virtual Interfaces on a Layer 3 switch, enabling IP routing directly on the switch itself and comparing this approach against the router-on-a-stick method from the previous lab.

Switch Virtual InterfaceIP Routing EnableLayer 3 Switch

~2 min read · Updated Sep 22, 2026

Lab Objective

Configure SVIs for two VLANs on a Layer 3 switch, enable IP routing globally, and verify inter-VLAN connectivity without using any external router.

Lab Purpose

Unlike router-on-a-stick, covered in the previous lab, a Layer 3 switch with SVIs routes traffic entirely internally at hardware speed, without funneling all inter-VLAN traffic through a single trunk link — the standard approach in modern enterprise campus networks.

Lab Topology

Switch1 (Layer 3 capable switch)
  Gi1/0/1 ---- PC-A (VLAN 10): 192.168.10.10/24
  Gi1/0/2 ---- PC-B (VLAN 20): 192.168.20.10/24

SVIs to configure:
  VLAN 10: 192.168.10.1/24
  VLAN 20: 192.168.20.1/24

Task 1: Create the VLANs and Assign Ports

Create VLANs 10 and 20, and assign Gi1/0/1 and Gi1/0/2 to them respectively.

Task 2: Enable IP Routing Globally

Enable IP routing on the switch, which is disabled by default even on Layer 3-capable hardware.

Task 3: Configure the SVIs

Create interface VLAN 10 and interface VLAN 20, assigning the appropriate addresses and bringing each up.

Task 4: Configure PC Default Gateways

Set each PC's default gateway to its respective SVI address.

Task 5: Verify Inter-VLAN Connectivity

Confirm PC-A can reach PC-B, and examine the switch's routing table.

Solution and Verification

Switch1(config)# vlan 10
Switch1(config-vlan)# exit
Switch1(config)# vlan 20
Switch1(config-vlan)# exit

Switch1(config)# interface gigabitethernet1/0/1
Switch1(config-if)# switchport mode access
Switch1(config-if)# switchport access vlan 10
Switch1(config-if)# exit

Switch1(config)# interface gigabitethernet1/0/2
Switch1(config-if)# switchport mode access
Switch1(config-if)# switchport access vlan 20

Switch1(config)# ip routing

Switch1(config)# interface vlan 10
Switch1(config-if)# ip address 192.168.10.1 255.255.255.0
Switch1(config-if)# no shutdown
Switch1(config-if)# exit

Switch1(config)# interface vlan 20
Switch1(config-if)# ip address 192.168.20.1 255.255.255.0
Switch1(config-if)# no shutdown

PC-A: default gateway 192.168.10.1
PC-B: default gateway 192.168.20.1

PC-A> ping 192.168.20.10

Reply from 192.168.20.10: bytes=32 time=1ms

Switch1# show ip route

C    192.168.10.0/24 is directly connected, Vlan10
C    192.168.20.0/24 is directly connected, Vlan20

Key Takeaway

Forgetting ip routing is the single most common mistake in this configuration — without it, the SVIs behave purely as Layer 2 management interfaces and packets between VLANs are silently dropped, even though the SVI IP addresses themselves appear correctly configured and each shows as up/up in isolation.

Written & researched by Dr. Shahin Siami

Related Articles

Hands-On Lab: Configuring IPv6 Static Routes

This hands-on lab configures static routes for IPv6 destinations between two routers, mirroring the IPv4 static routing syntax covered earlier in this series while highlighting the IPv6-specific command keyword and address format.

Continue

Hands-On Lab: Configuring Default Static Routes

This hands-on lab configures a default static route on an edge router to reach the internet through an ISP connection, demonstrating how a single route can represent every otherwise-unknown destination rather than requiring individual routes for each one.

Continue

Hands-On Lab: Configuring and Naming Static Routes

This hands-on lab configures static routes with descriptive names attached using the name keyword, improving documentation and making the routing table significantly easier to interpret for anyone reviewing the configuration later.

Continue

Hands-On Lab: Configuring Static Routing via IP Addresses

This hands-on lab configures static routes using a next-hop IP address rather than an outgoing interface, the generally preferred syntax, and compares the resulting routing table entry against the interface-based approach from the previous lab.

Continue

Hands-On Lab: Configuring Static Routing via Interfaces

This hands-on lab configures static routes using an outgoing interface rather than a next-hop IP address, demonstrating this approach's suitability for point-to-point links and its important limitation on multi-access networks.

Continue

Hands-On Lab: Installing a Wireless LAN Controller

This hands-on lab performs the initial setup of a Wireless LAN Controller, joins a lightweight access point to it, and creates a centrally managed WLAN, demonstrating the controller-based architecture that scales far beyond standalone access points.

Continue