Join Lazaro Diaz for an in-depth discussion in this video Static routing and default routing, part of Cert Prep: Cisco Certified Entry Networking Technician (00-101).
- Alright, now we have this particular network right in front of us, and what's goin' on is that everybody can ping their own gateway. Their routers can ping each other's, only their neighbors. But, they're not able to go from one place to the other, meaning the 192.168.1.0 network has no idea how to get to the 2.0 or the 3.0. The 2.0 has no idea how to get to the 1.0 or the 3.0, and the 3.0 has no idea about the 1.0 or the 2.0. So, we need to do something here, and this is where routing begins.
So, what we're gonna do is a combination of default routes and static routes. What is a default route? A default route, you can only configure them, though, on what's called stub routers, which are these end routers right here. Because you're gonna put 'em in one direction. So, we're gonna put 'em on the ends. Essentially, what a default route does, when a destination network reaches the router, that it is not present in the routing table, it will use the default route to match everything and just send it out the exit interface of your choosing.
That's what a default route does. So, the router doesn't drop any packets. A static route, on the other hand, you're being very specific and you're telling it, hey, I wanna go to this destination network that has this destination mask through this interface. So, you're being specific on how you're gonna send them either one way or the other, it doesn't matter. So, let's go ahead and we'll explain as we start doin' it, so let's do, let's start from router zero all the way to the left and work our way to router two.
So, let's start in router zero, we're gonna open that one up. And then, or router one, I should say, and then we're gonna go ahead and do the global configuration. And now we're going to set up a default route. And that's doing IP route 0.0.0.0 0.0.0.0, and it want it to go exit my S0/0/0 interface. Let me explain what I just wrote right there. What this first set of zeroes do is match whatever network you're trying to get to.
And the next set of zeroes will match whatever mask you're trying to get to. And then it will look for this interface and just send it out that way. That's what that particular command does. So, let's go ahead and copy that and take a look at the routing table so you can see how it looks like. Let's exit. I hit enter again and then copy run start. And now how do we look at our routing table? Show IP route. And you can see here that our gateway of last resort is set to zeroes.
You know that you have a default route. Also, by looking at the S with an asterisk. If you look at the S up here in the codes, it says static, and then the asterisk is the candidate default. So, there's your default static route so the router doesn't drop any packets. So, that means should we be able to get from PC zero to PC one? Let's give it a try. Let's click on PC zero, let's go to the command prompt under the desktop tab, and let's ping 192.168.2.1.
And let's hit enter. Now remember, this is IP version four, so we should always get a first request timeout, but when you start seeing anything more than just one request timeout, you need to start wondering what's going on. And I can tell you right now it's not going to work because, just because you set that default route, what does the request amount really mean? It means it got there, it just didn't know how to get back. That's what happened. So, what we need to do in order to make this work, it left your router, it knew where to send it, and this router said, oh, okay, you wanna go to 2.0, let me send you down, but when the process came back, it said, hey, I wanna go to the 1.0, that router says, I have no idea where that's at.
So, let's go ahead and give it, let's tell it with a static route. So, we're gonna go ahead and do that. Config T IP route, but now, we're gonna be specific, hey, I wanna go to the 192.168.1.0 network, and that network has a mask of 255.255.255.0. And I wanna go out my exit interface, S0/0/1, which you can see is this one right here, so we wanna go this way.
So we're gonna hit enter, and then we're gonna exit. And then we're gonna do a copy run start. Alright, and let's do a show IP route. And now we have a static entry, you notice there's no asterisk. There's a static entry that's directly connected. So, let's do that ping again, let's see what happens. Let's go back to PC zero. Let's come up here, I'm just gonna do an up arrow, it's the last command we typed, and now we get connectivity, because now it knows how to send it back. So, we're gonna repeat the same process in the other router.
We're gonna go to this router, and what are we gonna configure there? Our default route. But our exit interface is gonna be S/0/0/1, going out this way. So, we're gonna go to global configuration, IP route 0.0.0.0, match the network, 0.0.0.0, match the mask, S0/0/1, which is the exit interface, exit. Copy run start. And then show IP route to make sure that it is there. Always verify everything you do, especially in your certification.
Alright, so it's there, but we know what's gonna happen, he has no idea how to get to the two network, so let's go to the middle router, and now, let's do another static route like we did here, but for the three network. So, config T, IP route, if I can type it. 192.168.3.0, that's where I wanna go. 255.255.255.0. Through what exit interface? Well, if I'm going to go this way, I gotta come out that interface right there.
I like to call that my S triple zero, S0/0/0, remember that's router slot and port, and then we're gonna copy that. We're gonna exit. Copy run start enter, enter. And then show IP route. And now we have two static entries. One for the one network and one for the three network. So let's see what happens. And let's ping. 192.168.2.1, and we get a reply.
Let's see, let's go for it all the way, let's see if we can get all the way across. For the 1.1. And we made it, because what's happening? This router, the end routers have no match, have no entry for any of the networks. They're just matching whatever destination network comes through there. And they're just sending it off to their next router, and then it's the next router's job to take over and say, okay, where do you wanna go? Okay, I know where that's at. And it sends you off again. So, they're handing it off to each other.
This is the only router, right here, that has actual entries in the routing table for all the networks, connected and statically. These routers at the end do not, as you can see, the connected route is the 1.0 and the 10.1.1.4. After that, there is no 3.0 or 2.0. It's making matches with the default route. So you can play around with default routes and static routes in a combination to use and make your routing somewhat more efficient, so you don't have to keep doing static routes because if the routing, if there's a lot of static routes, the router has to look through the routing table for all those different routes.
So, if you can minimize it, it would be better. So there you go, default route to the static routes.
- The basics of networking
- The TCP/IP model vs. OSI model
- Understanding the Cisco three-layer model
- Collision and binary domains
- Converting binary to decimal and hexadecimal
- IP addressing
- Diagramming summarization
- Working Cisco IOS
- Managing Cisco internetworks
- IP routing
- Security with ACLs
- Configuring and verifying NAT
- IPv6 addressing