Concepts / VLANs

VLANs

Switched virtual interface

Also called SVI, layer 3 switch, interface vlan, multilayer switch

A switch's own address inside a VLAN: the VLAN's gateway when the switch routes.

The problem

carol, in engineering, needs to reach alice, in sales, but the building has no router, only two switches.

  1. coreSwitch gets a card in each VLAN on its own bridge: br0.10 with 10.0.10.2, br0.20 with 10.0.20.2. Each is a switched virtual interface (SVI).
  2. Each SVI is its VLAN's gateway: carol's default route points at 10.0.20.2.
  3. With forwarding on, coreSwitch routes carol's packet out of VLAN 20 and into VLAN 10: a layer 3 switch.
  4. alice's reply goes back the same way, through 10.0.10.2: no extra cable, no separate router.
The switch is the gateway of each VLAN
The switch is the gateway of each VLAN

An SVI is the switch's own address inside a VLAN. With one in each VLAN and routing on, a packet from VLAN 10 to VLAN 20 is routed inside the switch, with no separate router.

What you'd see

$ ip -br -4 addr show
br0              UP             10.0.1.2/24
br0.10@br0       UP             10.0.10.2/24
br0.20@br0       UP             10.0.20.2/24
br0.30@br0       UP             10.0.30.2/24
  • Run on coreSwitch.
  • br0 10.0.1.2/24: the bridge itself, the switch's own address in VLAN 1, used to manage it.
  • br0.10@br0, br0.20@br0, br0.30@br0: one SVI per VLAN, a VLAN card on the bridge, each holding that VLAN's gateway address.

Guess first

carol runs traceroute -n 10.0.10.10 to alice. How many hops does it list?

Show answer

Two: 1 10.0.20.2, coreSwitch's engineering SVI, then 2 10.0.10.10, alice. The switch counts as a router hop.

In short

A switched virtual interface (SVI) is a switch's own IP address inside a VLAN, which the hosts there use as their gateway. With an SVI in several VLANs and routing on, the switch is a layer 3 switch: it routes between VLANs itself, with no router on a stick. On IOS: ip routing, interface vlan 10, ip address …. Without routing, one SVI is just the switch's management address.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab