A misconfigured subnet mask on a router-on-a-stick subinterface is diagnosed and corrected through systematic CLI troubleshooting, restoring inter-VLAN connectivity. The fault—a /30 mask applied where a /24 was required—caused the router to drop traffic destined for hosts outside the narrowed address range.
Router on a Stick Troubleshooting
Let's troubleshoot our second issue with router on a stick. We're on the second issue now.
With this troubleshooting, I recommend every now and then just challenging yourself: what would you do in each of those scenarios? So as it pops up, when we find out new information, think, okay, what is the next step I would do? And then you can see if it lines up with something that I would do, or comes close to something that I would do. Now, whatever answer you come up with isn't necessarily wrong. There's a lot of right answers of what you could do next. There's some real efficient answers that maybe I'm not even doing the most efficient way, but this is what I found the most efficient way when I'm doing troubleshooting in the past.
Here I am, I'm on my demo laptop. I see that I can ping the local resource, my Demo Pi 1, which is on the same VLAN, but I can't ping my Demo Pi 2. There's something wrong with my Demo Pi 2.
So I'm going to bring up a command prompt. I'll bring up another command prompt here and let's try to ping. I always like to ping the default gateway and see if I just have connectivity. A lot of times I find that I don't even have that local area network connectivity and there's a problem, although I can say that I'm pinging Demo Pi 1, so I probably have at least some sort of connectivity. Yes, in fact, I can ping my default gateway, I'm good to go with that.
What is the next thing I can ping? I can ping the network that I'm trying to get into, 10.1.20.1, another resource in there. Maybe Demo Pi 2 might just be down or something. So I ping 10.1.20.1, and sure enough I can ping there.
If I wasn't able to ping that, one of the things that I would think about is, well, is my default gateway on my computer set right? Because it wouldn't know how to even get access to the outside world if it's not set right. So it could be something along those lines, or it could be that something's wrong with the IP routing.
Well, in fact, let's just jump over to our router at this point in time and see what's going on with it, because I can determine that my computer can get to the outside world just fine, it can get to 10.1.20.1. So I'm going to jump onto the router next and kind of see what's going on with that.
One thing I can do is ping 10.1 dot 20.22 and see if I can even ping Demo Pi 2. I'm not able to ping that, so there's an issue with that. I also like to just try, maybe once again Demo Pi 2's down, so I'm going to ping another resource. I can ping the switch, which is dot 12. Actually, that's not on the same network, so I can't do that.
Okay, so next what I'm going to do is just look at my routing table, show ip route, and see if there's anything wrong with that. 10.20.030. So that's interesting, this is a slash 30 versus the other network is a slash 24. So that would be a signal to me that something's off there. That interface is obviously up, otherwise it wouldn't show up in the routing table.
So I can do now a show run, and I want to take a look at the interface fa, this would be 0 1.20, if it's configured correctly. And take a look at that: the encapsulation .1q 20, that's good, that's fine right there. An IP address, 10.1.20.1, is fine. But if we see here, the 255.255.255.252, that shouldn't read that, that should read as a slash 24, not as a slash 30.
So I'm going to get into that interface. Here we go, we'll go into the global configuration, get into interface, and I want to correct this right here. I just like to highlight it, it's a fast way of me rather than me typing it out. I'm going to put 0 at the end, I'm going to hit enter. Let's take a look at that running config again, so I'll do a do show run interface fa 0120. And there we've corrected it. In fact, actually it's already pinging, so we know that we're up at this point in time.
We've now solved issue number two. It was a gateway issue right here, and the IP address could be wrong also, but it looks correct. So there is our second issue: it's the mask right there. The mask does need to be correct.
So what was happening here is I was able to ping from the demo laptop all the way up to the router, but the router didn't send it into the network because it saw that the network was much narrower in scope. There was only a few addresses in it, and so Demo Pi 2 fell outside of the range. So it saw it as being outside of the range, so it was not able to do anything with that packet, it was not able to forward it on.
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 →