CCNA · Lesson 10 of 13

Inter-VLAN Routing with a Layer 3 Switch and SVIs

The most common approach in companies: the switch itself routes between VLANs, with no router and no bottleneck.

By topologia.appUpdated: Nov 13, 2026⏱ 5 min❓ 4 questions📶 Level beginner

In a nutshell

A Layer 3 switch routes between VLANs using one virtual interface (SVI) per VLAN and the ip routing command.

In this lesson
  1. What is an SVI?
  2. Configuration
  3. When is an SVI up/up?
  4. Routed port towards the router or firewall
  5. Management SVI on a Layer 2 switch
  6. Router-on-a-stick vs. SVI
  7. What you must remember
  8. Exam-style questions

What is an SVI?

An SVI (Switch Virtual Interface) is a virtual interface that represents a VLAN inside the switch. It is created with interface vlan 10 and given an IP. That IP is the gateway of the PCs in VLAN 10.

Layer 3 switch with SVIs for VLAN 10 and VLAN 20 routing between PC1 and PC2 SW-L3 ip routing interface vlan 10 → 192.168.10.1interface vlan 20 → 192.168.20.1 PC1 · VLAN 10 PC2 · VLAN 20
The Layer 3 switch has one SVI per VLAN and routes between them internally.Edit in the editor ↗

Configuration

SW-L3(config)# ip routing  ← without this the switch does NOT route
SW-L3(config)# interface vlan 10
SW-L3(config-if)# ip address 192.168.10.1 255.255.255.0
SW-L3(config-if)# no shutdown
SW-L3(config)# interface vlan 20
SW-L3(config-if)# ip address 192.168.20.1 255.255.255.0
SW-L3(config-if)# no shutdown

When is an SVI up/up?

  • The VLAN exists on the switch and is active.
  • There is at least one active port in that VLAN (access, or a trunk that allows it) in STP forwarding state.
  • The SVI is not in shutdown.

If you create interface vlan 30 but no port is active in VLAN 30, the SVI stays up/down.

Routed port towards the router or firewall

To connect the Layer 3 switch to the Internet router, a routed port is usually used: switching is removed from the port and it gets an IP, like a router interface.

SW-L3(config)# interface g1/0/24
SW-L3(config-if)# no switchport
SW-L3(config-if)# ip address 10.0.0.1 255.255.255.252

Management SVI on a Layer 2 switch

A Layer 2 switch also has SVIs, but not to route: they are used to manage it over SSH. Since it does not route, it needs its own gateway (see the management VLAN lesson):

SW1(config)# interface vlan 99
SW1(config-if)# ip address 192.168.99.11 255.255.255.0
SW1(config-if)# no shutdown
SW1(config)# ip default-gateway 192.168.99.1

Router-on-a-stick vs. SVI

Router-on-a-stickLayer 3 switch (SVI)
Where routing happensOn the router, in softwareOn the switch, in hardware (ASIC)
PerformanceLimited by one linkHigh, no bottleneck
CostLowHigher (Layer 3 switch)
Typical useSmall branches, labsCampus and enterprise

What you must remember

  • SVI = interface vlan X, the gateway of that VLAN.
  • A Layer 3 switch needs ip routing.
  • An SVI is up if the VLAN exists, has an active port and is not shut down.
  • no switchport turns a port into a routed port.

Check what you learned

4 exam-style questions. Some have one answer and others ask you to choose several. Answer them all to complete the lesson.

Question 1 of 4 · One answerOn a Layer 3 switch, interface vlan 10 and interface vlan 20 have IPs and are up/up. PCs have the right gateway but there is no communication between VLANs. What is missing?
Question 2 of 4 · Choose twoWhich two conditions are needed for the VLAN 30 SVI to be up/up? (Choose two.)
Question 3 of 4 · One answerWhat is an advantage of inter-VLAN routing with SVIs over router-on-a-stick?
Question 4 of 4 · One answerOn a Layer 2 switch, interface vlan 99 is configured with an IP and ip default-gateway. What is that SVI used for?