Routed ports on a Layer 3 switch allow the switch to connect directly to a router by converting a switchport into a routable interface with its own IP address. This content covers the configuration steps needed to establish that link and verify connectivity between the two devices.
Layer 3 Switch Routed Port
If we're going to have a layer 3 switch, we still want that layer 3 switch to be connected to the rest of the world, and it's probably going to go through some sort of gateway to do that. In our network that we have set up, it's a router. But how do we connect a layer 3 switch to the rest of the world through a router? There are actually a couple of different ways to do that, and here we're going to set up a routed port on a switch.
The configuration that I have is I'm on this demo laptop right here, and I want to configure this layer 3 switch to connect into the router, and we're going to do this through a routed port on this switch right here. So the first thing I'm going to do is configure the router, and then we're going to get into the routed port on this switch.
I'm going to move this diagram off to the side there, and I've got all of my devices that are up on here, although for this particular one we're just going to be working with switch 1 and router 1. I'm consoled into the router with a cable right now, and I'm doing that because I don't have any kind of connectivity to it right now other than just the physical cable connected into it.
So what I'm going to do is first of all configure this router 1. I'm just going to do a show run, and we'll take a look to see what the configuration is on it currently. I see here's the fast ethernet, it's set up with an old IP address from one of the old demos. We want to change that, so I'm going to show run interface fa 0 1, that way we've got it up right here. Then I'm going to get into the global configuration mode, and interface fa 0 1.
Then I want to change this IP address, so I'll just highlight that and copy it, and we want this to be in our new VLAN. The IP address for our new VLAN, which I happen to have recorded right over here, R1 right here, so 10.24.0.2 is the IP address that we want. So, 10.240.0.2, and it's a slash 30, so I'm going to put that 252 at the end here. Really we only need two IP addresses for this one, one for the router and one for the switch. So I'm going to enter in that IP address right there and it's going to change, and there, that's the end of our router configuration. That's all we really need to do on that side of it.
So now let's jump over to the switch and configure the switch. I'm jumping on this switch here, and I'm going to do a show run interface, and we're looking at fa 1047, which is the one that that router is plugged into. So it's set up as a trunk line, so the first thing that we need to do is remove some of that configuration.
I'm going to get into the global configuration mode and get into interface fa 1047. I'm going to do a no on the switchport VLAN 2, and I'm going to also do a no on the switchport trunk. When I highlight the whole line, it highlights the carriage return, and so it automatically enters it in when I do that.
Then the other command I'm going to enter on here, which is our new command, is no switchport. What that does is it turns off the switching capability, and now we can assign an IP address to it. So I'm going to assign the IP address, and it is 10.240.0.1, and that'll be 255.255.255.252. Enter that in.
All right, so now that's entered in to this, and so now we have connectivity between two routed ports, and we should be able to ping between those.
So I think the next thing we'll do is we will try pinging them and see how successful we are. What I'll do is I'm just going to end out of here, and I'm going to ping 10.240.0.2 and see if we've got connectivity. And there you have it, we got connectivity to that, and so I am now able to ping that.
The other thing that I want to do is I'm going to test that out, so I'm going to bring up a command prompt, and 10.240.0.1, which is the switch side of this, and I have access to that, so that's great. Then I'm going to ping the other side of that, 10.240.0.2, and see if I have access to that - and it doesn't look like I have access. This is actually to be expected, and let's analyze why it's to be expected.
Everything is functioning correctly, except for the router doesn't know how to get back to this network. We're not going to cover that in this module, we're going to cover that in a future module.
But what's happening is this demo laptop 10.240.0.2 and realizes it's somewhere outside of its own network, so it needs to reach its default gateway. So it sends the frame to the default gateway, which is this layer 3 switch. The layer 3 switch knows where to go - it's a directly connected network - and so it sends it to the router, and then it reaches the router. But the problem is the router is not aware of all of the networks down here. So we need to establish like a static route, or we need to establish some sort of routing protocol; we need something for it to communicate back. So that's not going to happen yet.
In fact, what we can do is jump onto the switch and just do a show ip route, and we can see that it sees all of the networks that we're concerned about right here. Show ip route on the router, and we can see that it really only knows of the directly connected networks to it. It's not aware of the 10.1.10 network or any of the other VLANs; it's just not aware of those.
So for now, just know that this is one of the ways where we set up a routed port on our layer 3 switch, and then we set up the router just as a standard routing port, and then we have communication.
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 →