TechKnowSurge
Cisco CCNA 2.1 Cisco CCNA 3.3 Cisco CCNA 1.2 Cisco CCNA 1.13
VideoNetworkFree

DEMO: Configuring Layer 3 switch

Layer 3 switching enables inter-VLAN routing directly on a capable switch using Switch Virtual Interfaces (SVIs), eliminating the need for an external router. This topic covers how Layer 3 switching works and how to configure it on a Cisco 3750.

Complete this video to capture a CTF flag worth 1 point.

About this video

Layer 3 switching is the preferred inter-VLAN routing method in enterprise and campus environments because it consolidates switching and routing functions into a single device. Unlike legacy routing or router-on-a-stick configurations, a Layer 3 switch uses Switch Virtual Interfaces (SVIs) — logical routed interfaces assigned to each VLAN — to build an internal routing table and forward traffic between VLANs without sending packets to an external router. This eliminates additional physical links and simplifies the overall network topology. A key performance advantage of Layer 3 switching is backplane speed. Inter-VLAN traffic routed through an external connection is limited to the speed of that physical link, typically 1 Gbps or less. On a Layer 3 switch, that same traffic moves across the internal backplane, which can operate at 10 Gbps, 40 Gbps, or higher depending on the hardware, and on higher-end switches that full bandwidth is available per port rather than shared across all ports. Configuration is straightforward. An SVI is created for each VLAN and assigned an IP address that serves as the default gateway for hosts in that VLAN. Once all SVIs are in place, the ip routing command is entered in global configuration mode, which activates the routing engine and populates the routing table. At that point the switch begins routing between VLANs immediately. It is also possible to assign a secondary IP address to an SVI, allowing a management address and a gateway address to coexist on the same interface.

What you'll learn

What's covered

Layer 3 Switching

Aligned to

Cisco CCNA
2.1 Configure and verify VLANs (normal range) spanning multiple switches
3.3 Configure and verify IPv4 and IPv6 static routing
1.2 Describe characteristics of network topology architectures
1.13 Describe switching concepts

Key terms

Virtual LAN
VLAN
A logical grouping of network devices that behave as if they are on the same network regardless of physical location.
Layer 3
The Network layer of the OSI model, responsible for logical addressing and routing packets between networks.
Router
A network device that forwards data packets between networks based on IP addresses.
Switch
A network device that connects devices within a LAN and forwards traffic based on MAC addresses.
Default Gateway
The router that a device uses to send traffic to destinations outside its local network.
Switch Virtual Interface
SVI
A virtual layer 3 interface on a switch associated with a VLAN. On a layer 2 switch a single SVI provides the management IP address; on a layer 3 switch, SVIs also route between VLANs.
Inter-VLAN Routing
The process of forwarding traffic between two or more VLANs using a Layer 3 device, which is required because VLANs are separate broadcast domains and cannot communicate at Layer 2 alone. Inter-VLAN routing can be implemented using a physical router with a trunk link (router-on-a-stick), a multilayer switch with SVIs, or routed ports.
IP Routing
A command entered on a Layer 3 switch that enables the switch's routing engine, allowing it to forward packets between VLANs using its routing table.

Topics

Networking Inter Vlan Routing Layer 3 Switching Switch Virtual Interfaces Cisco Ios Vlan Configuration

Transcript

In this module so far we've talked about legacy routing and how to set up legacy routing. We talked about router on a stick and how to set that up. Now let's get into a layer 3 switch. This is the more common setup out there when you get to a larger organization.

How a layer 3 switch works

A layer 3 switch is a switch that has the capability of doing routing. In this case right here, I have 2960s sitting out here and I have a 3750, and this 3750 is a layer 3 switch, which means it has the capability of routing between networks. My 2960s do not. So with the 3750 we're able to set up layer 3 switching.

A layer 3 switch is that you have switch virtual interfaces within your switch. I'm going to use the red to symbolize that there's virtual interfaces inside of this switch, and you have a virtual interface for VLAN 10, one for 20, one for 30, one for 40 — one for each of your VLANs. What will happen then is that it will establish a routing table. So when a frame comes into the switch and the packet needs to go to another VLAN, then it will move it from one VLAN to the next using these SVIs, the switch virtual interfaces. That's essentially how it works: you have a routed interface in the form of an SVI on the back end, and it is routing between those.

Advantages

The advantage of this over other situations that we've had is, number one, we don't have the complexity in the wiring. We don't have to have multiple lines going up to the router. We also don't have to configure the router to be able to have a trunk line.

But perhaps one of the biggest advantages to this is that between your VLANs you have the speed of the backplane. What I mean by that is this ethernet connection between these two devices has a certain speed — that's maybe a hundred Meg, maybe a gig, but there's a limitation to that, and that limitation is most likely quite a bit less than the backplane of this switch right here. Typically on a switch you've got this much faster speed between your connections, so maybe it's a 10 gig backplane, maybe it's a 40 gig backplane. And with these nicer switches the backplane is a true backplane, where from one switch port to another you get the full 10 gigs; it's not split amongst all of your different switch ports. So you can get much faster speeds with this, which is one of the reasons why it is the preference.

The other thing too with this is it's fairly simple to implement this and to get this set up and running, so it takes away some of the complexity from that and just makes things more scalable. So this really is a more common way of setting it up when you start getting into the larger enterprise and campus area networks.

Configuring it on the switch

Now, how is this set up on your switch? It's actually really easy. I am on my demo laptop right here. I have now consoled into my switch 1, and I'm using my console cable to get into there because we may break connectivity — we're going to change the IP address of the management interface. So I'm consoled into it and we're going to configure it.

I'm pinging down here. I'm pinging demo Pi 1 and I can see that I have access to it, because it's on the same VLAN. I'm also pinging demo Pi 2 and I don't have access to it right now, because I don't have any kind of routing setup on here.

So I'm on my switch. You've actually already configured one of these before, so let's take a look at the SVI that we've already configured on our switch. I'm going to scroll here. It first of all goes through all the VLAN configurations, then all the interfaces. There's quite a few interfaces on here — 52 interfaces. Those are physical interfaces. And then I get down to my management interface. This is interface VLAN 10, and it has an IP address of 10.1.10.11 and a subnet mask of 255.255.255.0. So that is configured on this device.

What we want to do is configure a default gateway. We want to configure this as being a default gateway, so I'm going to configure it to be 10.1.10.1. And then we also want to configure it for VLAN 20, because we want to route between those two networks. So let's go ahead and do that. I'm going to get into the global configuration mode. I want to get into VLAN 10, so I'll get into VLAN 10. I want pretty much this IP address right here, so I'm going to do that right there, and I'll do 10.1.10.1.

I am connected into this switch virtually — I'm SSHed into it right here — so we'll see what happens to that connectivity when we change this. I'm going to hit enter on this to make it happen. And then we also want to change VLAN 20, and it's a similar default gateway for that one, so I'm going to just copy this right here, and then 10.1.20.1, and we'll configure that right there.

So I've got those two. I can see, if I pull this up, that when I did that I lost connectivity. So I don't have connectivity — in fact, it'll pop up with an error message here in a second.

There is one more step. As you can see, it's not routing between these devices yet. In fact, I can do show ip route, which shows my routing table, and I can see that it really hasn't anything in there; the routing table is not set up. And there was my notification that I lost connectivity.

So I'm going to exit out of here, and the last command I need to do is ip routing. So I'm going to do ip routing, and this tells the machine that it's going to be a layer 3 switch. And look — instantly, or almost instantly, we now can ping demo laptop 2. So the setup of this is really quite easy.

Now let's take a look at the do show ip route. Let's take a look at the routing table, and we can see that it is populated now. So we have connectivity of our different devices out there. We did it: everything is functioning and we can communicate across. So layer 3 switches can actually be pretty simplistic to set up. And if we wanted all of our VLANs to communicate, then we could do that as well.

Adding a secondary IP address

One other thing that I'll show you that we can do as well on here: I'm going to get back into the interface. I'm going to get into interface VLAN, and the other thing I can do is set an IP address on here. So I'm going to do show run interface VLAN 10, and I'm going to change this back to .11. And I'm going to show you that there's this secondary right here. So what I can actually do on this interface is I can do a secondary, hit enter, and now take a look at my running config. Now I have this entered in as a secondary, so I still can remote into this machine. I can come in here and restart this interface using that original IP address that I set for it, but then also have the 10.1.10.1 be the default gateway for this. So I've got both now, and it's set up to do both, so I can have two IP addresses on there.

That's just a side note, but anyways, that's how you set up these switch virtual interfaces on the layer 3 switch. Then you type in ip routing, and now your device is set up and it is routing.

About TechKnowSurge

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 →