Introduction to Routing
We’ll start our walkthrough with a basic network and follow the decision-making process from the point of view of the host, then router.
We’ll start with this iconfig output from our host PC.

When a host sends a packet, there are two possibilities regarding the destination host.
- It’s on the same subnet as the packet’s source.
- It’s not.
And that does impact how the packet is handled.
Connected Route Walkthrough

If the host is sending packets to a destination IP address that’s on the same subnet, there’s really no routing involved, and the packets in this network are going to go straight from 192.168.1.100 straight to 192.168.1.15. We know they’re on the 192.168.1.0/24 subnet.

But here, Host A is sending packets to Host C on the other side of the router. So when you see a host on one side of the router (so to speak) of one interface and the other host is on the other side, there’s going to be some kind of routing that has to get involved. Because Host A is looking at this and saying” packets for 10.1.1.5 ! I don’t know where to send those!” . So the host sends the packets to its default gateway which we saw in the ipconfig output (192.168.1.1) which happens to be the fast ethernet interface that’s on that side of the router facing that particular host. That’s what you would want the default gateway to be; is that router interface, a router IP address. Because what the host in that situation is saying is: “I don’t have the faintest idea what to do with these packets, so I’m just going to send it to my default gateway and hope my default gateway can figure it out. ”
So the packets are going to go through the switch and arrive at the router.
R1 is our Cisco router. To see the first routing table that we’ve taken a look at (This is going to be every IP route the router knows about) we’ll do ‘show ip route’

You’ll not use some of those codes. But we’re definitely interested in this “connected” type route right now because that’s the only kind of rout we have in here right now, and you can see there are the letters “C” at the bottom. ( always look over here for the code )
You can see the two entries that the router has and it’s got an entry for 10.1.1.0 directly connected on FastEthernet0/1, and 192.168.1.0/24 network is directly connected to on the other side of the router or on another FastEthernet interface.
So that’s where we are right now, and the router gets those packets with the destination IP address of 10.1.1.5 and it looks in its routing table and it’s going to look at all of its routs , looking for the best match, and we will see scenarios here as we progress to the course where you have more routes to choose from and the router has several valid routes to pick from but here it only has one. So the search for the best route is a pretty darn short one! It’s 10.1.1.0 directly connected to FastEthernet0/1.
So when the router receives those packets, because it does have an entry for them, then it’s going to go straight through.
when a router receives a packet, the destination fits one of these descriptions:
- A directly connected network like the two we just saw
- It could have a non directly connected network that the router has an entry for in its IP routing table
- A non-directly connected network that the router has no such entry for. This is the one we got to really watch out for.

Now in the case of directly connected network that we just saw, This is exactly what happened. It’s a 1-2-3 step. The packet get sent by the host and host says “ OK this got to go to my default gateway at 192.168.1.1 , because this destination is on another subnet.
The router receives packets on Fastethernet0/0 and when it’s processing them, looks at the routing table and says: “ Do I have a match for this?”
And here is the match for the destination

The router says: ”OK I’ll now send these packets out 0/1. Host C of the switch will receive them.”
Static Route Walkthrough
We’ve got Host A connected to a switch which in turn is connected to router 1. You see the IP addresses there, and you also see that we have another router (R2) which has IP addresses that are slightly different. So we’ve got Host B over there (30.1.1.5)

Let’s see what happens to packets of R1 in two different situations using this particular network.
Now Host A being 10.1.1.5/24 now would need its default gateway set to 10.1.1.1 at this point (the FastEthernet interface on that router that is facing Host A).
So Host A at this point wants to send packets over to Host B at 30.1.1.5, sees that it’s definitely on a different subnet, sends those packets to its default gateway at 10.1.1.1 and I also changed the address on router 1 to reflect what you’re seeing here.
So the routing table that we see on router 1, is this:

Two different ways to look at that table. You can run ‘show IP route’ which will give you that code table and then a little information about something called “the gateway of last resort” and then it’s going to show you every route in the IP routing table.
If you just want to see connected routes, ‘show ip route connected’ is the way to go because in the future you’re going to have routing tables that can take up this whole screen! And you can have six different kinds of routes and if you just wanted to look at the EIGRP routes for example, you can just do ‘show ip route EIGRP’.
Here we’re doing ‘show ip route connected’ just to illustrate that command to you.
Now let’s see what would happen here. Because if packets come in to this router and they’re destined for the 30.1.1.0/24 network, what happens?
Well, the router goes to its routing table and starts looking in the routing table for the best match (parsing the routing table)
Well in this case, it doesn’t have any match at all, best or otherwise, because 30.1.1.0 does not match either one of those two entries we have in there in any shape or form.
So what happens in that scenario? Unfortunately the packets get dropped.

They do actually come into the router but then as the router is processing and says: “ hey I have absolutely no idea what’s going on here. I don’t have an entry for 30.1.1.0 ! so I’m just going to drop these packets! “ and that obviously is not what we want.
So in the real world, what you would do is most likely configure a dynamic routing protocol between these two routers either “Version2 EIGRP” or “OSPF” and then they would automatically exchange some information once they form an adjacency (or not in the case of Version2) but you’ll see that. But they would still talk to each other and say: “ here are the routes I know about! Which routes you know about? Oh ok thanks for those! I’ll put them in my routing table.”
That’s really fundamentally what the routing protocols are for. But none of them run by default so we don’t have any way right now for a Router2 to tell Router1 : “Hey I know how to get to the 30.1.1.0/24 network!”
So we need to do something out Router1 right now to tell Router1 : “Hey if you don’t have a match for a particular packet, here’s where to send it!”
And that’s what I’m going to do now with what I call a “default static route” and a static route is exactly what it sounds like. It’s a route that you and I (the network admins) actually create and hopefully it goes into the routing table like we like it to.
And that’s what we’re going to do here, and with the default static route, the name is a little misleading because when we hear the word ‘default’ in our business, what do we thank about? That’s what happens if we change something else. That’s the first thing that’s going to happen. The default static route is more like a route of last resort, or maybe a gateway of last resort as we’ll see. What it is doing, it is saying: “OK Router! If you don’t have any other match for these packets and there’s no other match in the routing table, then send them to this IP address or throw them out (technical term) this particular interface! Send them out this interface or send them to the next IP address.”
Let’s show you the command for this because it looks strange. It’s an odd looking command.

With ‘ip route’ the first thing we’re actually putting is the destination prefix. We’ll write some more static routes throughout the course. But right now with the default one that’s going to be all zeros.
Then the destination prefix mask is going to be all zeros too.
So a default static route is IP route all zeros and then all zeros again.
Then we have a choice to make.

You’ll see that at the very top it says forwarding router’s address and then everything else on here is an interface type.
If you put an IP address in this command then you are putting the IP address of the next hop router, and in this case if we go back to the diagram, where would we want Router1 to send those packets to? We don’t want them to go back out Fastethernet0/0 ! That wouldn’t make any sense.

What we’re doing here is saying: “ok send them down to 20.1.1.2 which is Router2 FastEthernet0/0 interface and basically what we’re doing there is the same thing we do with the default gateway on Host A. We’re saying : “Send these packets to this address and I hope that address knows what to do with them.” We know from looking at this diagram that it will.
So let’s make that happen.
we’re going to use the IP address in a moment but if you specify the interface, you’re specifying the local routers interface ( the router you’re on ) and I’m saying that because I know this is going to come up on your exam one way or another, and if it came up a multiple choice, they could give you IP route 0 0 0 0 0 0 0 0 and then put the local router’s IP address which would be incorrect.
Now this is one of those things where if I actually tried to put the local IP address in:

The router will not let me do it, because I’m trying to put in next hop address that actually exists on this router.
So if you’re putting an IP address in, you’re putting the downstream router’s IP address in.
If you’re entering an interface, you’re entering the local interface and you’re saying: “Hey! Put those packets out this particular interface and let’s hope that downstream router can get them.”
No right or wrong way to do that or way to make a choice. I just like to specify the IP address myself so I’m going to say 20.1.1.2 and that’s it.
So that’s our default route.

Now let’s have a look at the big routing table (show ip route) and a couple of changes here:
First: We have a new route. But look at the next to gateway of last resort, and now says ‘is 20.1.1.2 to network 0.0.0.0’ so what we’ve done now is really giving this router a default gateway ( a gateway of last resort ) saying: “Any packets that don’t match the other entries, send them to 20.1.1.2 “
And notice the code here next to the new route -down here at the bottom- , and you can see there is a ‘S*’ ! that unique combination is unique to a default static route. Because static routes are indicated with only with an ‘S’ , and if you have a candidate default route which in this case is definitely the default route because it’s the only candidate default we have, it’s going to have an ‘*’ next to it.

So when you see an “S*’, you know you’re dealing with a default static route.
And you can see via 20.1.1.2 is the entry and that’s exactly what we want.

So at this point, when packets come in on Router1, this is what ‘s going to happen: Router1 is going to look at its routing table and it doesn’t really have a specific match for 30.1.1.0 because the only routes it knows about, are the connected routes. But it will then say: “ OK I’ve got a static default route! I have a gateway of last resort at 20.1.1.2 so I’ll send them to 20.1.1.2 and then I’ll let that device sort it out.” , and we know that since Router2 is connected to the 30.1.1.0/24 network, it would have absolutely no trouble forwarding packets to 30.1.1.5 .

Note: if at this point we wanted packets to go from B to A, We’d have to write another static route on Router2 because if Router2 gets packets where the destination is 10.1.1.0/24 , again Router2 won’t have any idea what to do with this packet so it will drop them unless we wrote another default static route. The reason to mention this is when you’re starting to send pings when or when you starting to check connectivity as we’ll be doing, the packets have to go from A to B obviously but they also have to get some replies from B to A, and don’t take it for granted that just because A can communicate with B, that B can necessarily communicate with A. That’s just a good advice for your networking career because people tend to look at if you send a ping right now, it would go from A to B but it wouldn’t have a way back unless we put a static route on that too. But then if the ping failed, people tend to concentrate on Host A and say: “OK what’s the trouble here? What’s the trouble with Router1?” Your pings maybe getting where they’re supposed to go. But there may be no path back and always make sure there is a path back.