Covers how to configure a host-specific static route on a Cisco router, explaining why return traffic fails without one and how a /32 subnet mask targets a single IP address.
Static Route to Single Host
Let's figure out how to set up a static route to a specific machine or a specific host.
I'm pinging two interfaces here again. This time what I'm pinging is this router right here. I left the configuration on from before, so therefore the default route is still on the layer three switch, and it's going to send any traffic this way that it needs to to get to the rest of the world, the default route. And then this router right here knows how to get back to the demo laptop. What I'm pinging right now is this router interface right here. I'm pinging router two, and the interface on this link right here.
So think through: why is this not successful? Why is the ping not successful? It's a very similar answer to the last two.
What's happening is this demo laptop is trying to ping this interface right here. It sends out to its default gateway, which is the layer three switch. The layer three switch says, well, I don't know what to do with this, so I'm going to send it out my default route. And my default route sends it to this router right here. This router, router one, is directly connected to this network, so it knows how to get to this IP address. So it sends it out to this router, and this router receives it.
Here is where the problem comes in: because now this router doesn't know how to reply. It's not aware of the 10.1.10.0 network, so it doesn't know that it needs to send this information back to router one, a reply back to router one.
So what we can do in this case right here is we're just going to set up a single host so that it can ping the demo laptop, but it won't be able to ping any other device. Let's see what that looks like.
I'm on switch two now, or excuse me, I should be on router two here. So let's jump on to router two, which I believe is this one right here. And then I'll need the enable password. And we'll get into the global configuration mode on here, and the command that we'll use is ip route.
Hopefully that's still the IP address of this, so I'm going to check ipconfig, and yes, it is. So there we're good to go. Then we need a subnet mask. Since we're specifying a specific host, it's actually all ones for the subnet mask. And then we're going to specify that this is going to head back to router one, which the address of router one on that interface is 10.240.2. The 2 is the interface there.
Let's see, make sure everything's correct here, and we're going to hit enter. And if we got it right, yes. So now we can ping back, because this router knows how to get to that specific interface.
Another interesting thing with this: I'm going to actually exit out of this and let's do a show ip route, and we can see that single static entry in there.
And I'm going to try to ping directly if the firewall's down, which I believe it is. So I'm going to try to ping directly there. And it is not going through, so my firewall might be up. Everything else should be set up successfully. So let me just check my connection settings. Okay, I turned my firewall settings off. So now I'm able to ping. I can ping 10.1.10.34. I'm successful. So now I can reach my demo laptop.
But what's interesting about this is if I try to ping something else on the network. For instance, let me just try to ping the default gateway in there. I should be able to reach this, there's no firewalls or anything like that, except for it doesn't know how to get to 10.1.10.1, because we specified just the demo laptop for that network, not the network altogether.
You can have some fun with this and kind of play around with how to ping the different devices and how to set up static routes. If you've got a setup, play around with it to see what you can get functioning. It could be a fun little project actually.
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 →