A Switched Virtual Interface (SVI) on a Layer 3 switch provides an alternative method for connecting that switch to a router, using a dedicated VLAN and an access port rather than a routed physical port. This approach assigns an IP address to the VLAN interface itself, allowing Layer 3 communication between the two devices.
Layer 3 Switch SVI to Router
Let's continue this discussion and figure out the other way of connecting our layer 3 switch to our router. Previously we did a routed port on the layer 3 switch; now instead let's create an SVI and connect it to the switch and see what that looks like.
For this we're going to set up our router the same way — it's going to be just a standard routed port on the router, and we're not going to do anything special with that. Then for the layer 3 switch what we're going to do is set up another switch virtual interface on another VLAN, and then we are going to create a connection into that VLAN via one of the ports for the router.
Really the configuration of the router is exactly the same in both these scenarios, so I'm not going to cover it again, although I will show you just the configuration really quickly, because it doesn't take that long. I'm going to do a show run interface fa, and that is on our 0/1 port, and take a look at that. We can see that I have the IP address, and this is just a standard connection on a router, so that's good to go.
Next, how do we configure this switch part of this? I'm going to jump over to the switch now and we're going to configure the switch. Now, this switch is going to be an SVI, so we need a VLAN that we're going to have this switch virtual interface on. The first step here is to create a VLAN for that.
I'm going to get into the global configuration mode and I'm going to create — we'll call this VLAN 9 — get into VLAN 9. I'm going to name it, and we'll just call it router, we'll keep it simple for now. So I've named it router, and I'm going to exit out of this.
Next I need to get into the switch virtual interface, so I'm going to jump into that: interface VLAN 9, that's the switch virtual interface. We're going to give it an IP address, and the IP address is going to be 240.0.1, and it's a slash 30, so let's do a 255.255.255.252. We'll enter that into there. So now that VLAN has an IP address associated with it.
Next I'm going to get into the interface that's connected to the router, so I'm going to do interface fa1/0/47 — that's the interface to that router — switchport. I'm going to turn this into an access port. It's not a trunk line; we're not setting up a trunk line between these two devices. So switchport mode access — I'll do switchport mode access and turn it into an access port — switchport access VLAN, and it's going to be that VLAN 9, and now it's assigned to it.
Now we have connectivity through the SVI to the router, so we should be able to ping between those two devices. Let's jump in and see if we can ping. I'm going to end through here, and 10.240.0.2, and I'll try to ping that and we'll see if there's connectivity — and we have success, so we can ping between these devices.
Now, if I were to bring up a command prompt, I would still be able to ping 10.240.0.1, because these devices are all connected together. But one thing I would not be able to ping is the router from this device. The reason is because this device knows how to get to its default gateway, which is on the switch, and the switch knows how to get to the router, but the router doesn't know how to get to anywhere but that local area connected connection.
In a later module we'll actually talk more about routing and how routing works, but for now just realize that to connect these devices we will have to establish some sort of connection between these two devices. We've made it happen — I can show you that it's pinged, so we are good to go, we're connected.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →