Modern multi-layer switches seem to support both SVIs (switch virtual interfaces) and subinterfaces concepts. Both are virtual layer 3 concepts used to perform routing functions and some equipment supports both.

Sometimes the documentation can even put composite limits on both SVIs and subinterfaces, highlighting the similarities as well. Here is a snippet for Cisco Catalyst 9500 Series Switches.

You cannot configure more than 4,000 Layer 3 VLAN interfaces. The sum of all the routed interfaces, SVI interfaces and subinterfaces should be equal to 4000 or less.

What are the differences between SVIs and subinterfaces for multi-layer switches? Can one always be used in place of another?


Another aspect to and expanding a bit what zac67 already gave in his answer:

VLAN IDs used on tagged (sub)interfaces of routed interfaces (a.k.a. no switchport) can be completely independent from the switch's "switching" context [1].

In extenso: the VLAN tag used on the subinterface does not appear as a L2 VLAN on the switch, neither consumes nor is part of any instance of (per-VLAN-)spanning-tree, and won't be part of any VTP/GVRP setups etc. There can even be subinterfaces of multiple routed interfaces using the same (overlapping) VLAN tag - and they'd be completely independent: Sometimes, this s referred to as "port local VLAN awareness".

To give a freedhandedly composed config example, in pseudo Cisco config speak. Essentially, this is very similar to how classic routers (ISR G1, ISR G2, ISR 4K et) get VLAN aware subinterfaces (of course, classic routers don't need the "no switchport" part)

interface gig1/1
 no switchport

interface gig1/1.100
 encapsulation dot1q 100
 ip address

interface gig1/1.200
 encapsulation dot1q 200
 ip address

interface gig1/2
 no switchport

interface gig1/2.100
 encapsulation dot1q 100
 ip address

SVIs in contrast are based on the existence of the given VLAN (as in: "L2-VLAN") on the given switch. So to have an SVI, you'd need to first create the said VLAN, get its spanning-tree right, check if it's part of VTP/GVRP if so intended etc.

Then you'll make sure the switchports pertaining to it are set right (some will be access vlan xxx, some might be switchport trunk allowed vlan xxx, some with portfast, some without...), and then you can add the SVI by virtue of interface vlan xxx.

Since VLANs are unique per switch (at least for a plain vanilla, non VDC capable switch), this uniqueness restriction applies to SVIs, too. You can't have multiple interface vlan xxx for the same VLAN ID.

vlan 100
 name MyVLAN100
vlan 200
 name MyVLAN200

spanning-tree vlan 100 priority 16384
spanning-tree vlan 200 priority 16384

interface vlan 100
  ip address

interface vlan 200 
  ip address

interface gig1/1
 switchport mode trunk
 switchport switchport trunk allowed vlan 100,200
 spanning-tree port type edge trunk

[1] Well.. somewhat. There are/were switches (Cat6500, for example) that would consume a VLAN ID (henceforth hidden) when configuring a routed port, and they had their issues with or plainly did not allow tagged subinterfaces of such routed ports. Behind the scenes, they would internally configure a VLAN without spanning-tree, map the configured port into that VLAN, and add an SVI with the pseudo routed port's configured ip address).

| improve this answer | |

The term SVI and subinterface are almost same . It's functionality seems to be same as well but it's terminalogy changes as where we are using it ..

General sub - interface configuration is used in routers for router and stick configuration or inter-Vlan configuration to ensure communication between different Vlans or different subnets..

Whereas SVI(switch virtual interfàce) are configured in layer3 switches or multilayered switch the switch which can operates on both layer2 and layer3 .. SVI configuration in layer3 switch will ensure communication between different Vlans or different subnets ..

Sub interfàce configuration in router

It is L3 interfàce for particular subnet

Router(config)# int f0/1 Router(config)#no ip address Router(config)#no shutdown

Router(config)#int f0/1.10 Router(config)#encapsulation dot1 10

Router(config)#ip address

Router (config)#no shutdown

SVI configuration layer3 switch (multi layer3 switch)

Switch (config) # interfàce vlan 10

Switch (config)#iip address

Switch (config) #no shutdown

| improve this answer | |

A subinterface is part of a physical interface, used for a single VLAN. Usually, you only have those for routed interfaces (L3) that do not take part in L2 forwarding = switching.

An SVI (switch virtual interface) is a network-layer binding (L3) to the VLAN instance itself - since the VLAN is distributed across all participated ports, that binding is virtual (switch virtual interface). Like a subinterface, an SVI can be used for routing, management, DHCP, ...

The major difference is that an SVI is bound to a VLAN used for L2 switching, while a subinterface is part of an L3 interface that doesn't take part in L2 switching. Accordingly, a specific VLAN ID on a subinterface may indicate a different VLAN (L2 segment aka broadcast domain) than the same VLID on another interface.

| improve this answer | |

When you have a layer-2 configuration with VLANs, each VLAN basically acts as a virtual switch. That's the point of VLANs, after all. You can think of the traffic flow as coming in through a port, getting split up (demultiplexed) into different VLAN flows, getting L2-switched independently in each VLAN, and then on the outgoing side, flows from different VLANs get combined (multiplexed) again before they flow out the single physical port.

(Of course, switches aren't actually implemented with separate wiring for each VLAN. They mostly act as if they are)

The switch also has some kind of layer-3 processing hardware which implements a virtual router (but not a switch).

An SVI connects one of the VLAN virtual switches to the virtual router. If the packet is broadcast or addressed to the virtual router, it gets forwarded there, just as it would get forwarded to a host attached to a port in the VLAN. (There can be additional filtering, as an optimization)

By contrast, a sub-interface connects the virtual router directly to the VLAN multiplex/demultiplex layer. This means each port/VLAN combination can have a separate layer-3 interface. It also means layer-2 forwarding doesn't apply on that port/VLAN combination.

Some switches only support one mode or the other per port, and some switches let you mix-and-match, with L2 bridging for some VLANs and L3 sub-interfaces for others.

This is a conceptual model - actual implementations may differ.

conceptual block diagram

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.