Routers use routing tables to forward packets toward their destination by matching the destination IP address against a list of known routes. This content covers how routes work, what information they contain, and the key types found in both IPv4 and IPv6 routing tables.
Routes & Routing Tables
When a packet comes into your router, your router takes a look at that packet and looks at the destination IP address inside that packet. Then it makes a determination of where it needs to send that out. It makes that determination based off of what it finds in the routing table. And what does it find in its routing table? A bunch of routes.
A route is a direction or mapping to a network. So let's give a little example here. In this network diagram I have three routers, we'll call this router 1, router 2 and router 3. We also have a layer 3 switch, so this layer 3 switch acts as a router as well. And off of this layer 3 switch we have several VLANs, one of which is this VLAN 10, VLAN 10.1.10.0/24. So that is its network address.
Let's say that all these layer 3 devices, so these three routers and the switch, know of this network. On this layer 3 switch right here, that's a directly connected network, and so within the routing table it would show a route to that directly connected network. However, for router 1 this network right here is not directly attached, and so it has a route, but the route points to this switch. Same thing with router 2: router 2 understands this network of 10.1.10.0 and knows how to get to it, but it knows that it gets to it through router 1. And then router 3 understands it gets to that network through router 2.
So these routes are specific to the router. They're different. It's the same network, pointing to the same network, but they point to different devices depending on where they fall within this network. So that is a route: it's a pointer, a mapping towards a network.
So here's a couple examples of that. This is off of that layer 3 switch. We can see that because it's a directly connected network it has information about that network and the fact that this is directly connected on this router. We can also see that it has a mapping for 10.2.0.0/24, so that network shows up on this router as well, and it has a route 10.240.0.2. That's the next hop. So if information comes destined for this network right here, it will then send it to this router right here, which is the next hop.
These routes are stored on a routing table. Routing tables can be found on each of your layer 3 devices. And what will happen is a packet will come into that router or layer 3 device, that router will then reference the destination IP address with the list of routes that it has, determine what the best route is, and then send it on its way.
A couple pieces of information that you should consider when this is happening. Not all routers necessarily have all up-to-date information, which could be problematic in some cases, because each one of these routers makes a determination of where it's going to send this packet on to next. And the other thing to keep in mind, and we've experienced that while going through this course, is that just because it knows how to get to a destination network, it doesn't necessarily know how to get back to where that packet came from for a reply. So just because there's communication across this network one way doesn't necessarily mean that there's communication across it the other way.
So what would you see as part of a route? Well, the first thing that we see is that it has the network address, so that's the network address that it's going to associate with. Another thing that we see in here is what is the next hop, and in many of these cases it's by IP address, so we see that in here. We also see some directly connected networks in here. So if it's a directly connected network, you can see that it will specify that not only does it have the next hop IP address, it also has the exit interface. So for these right here it's VLAN 9.
We also see some other information in here. We see this 110 right here. That's what's called an administrative distance. You can see that we have the administrative distance of 1 for this statically assigned route, and then for this OSPF routes we have an administrative distance of 110, and we'll get more into that a little later. We also see the cost to each one of these networks, so this is the cost that it takes to get to each one of those networks. And then the other thing that we have is the time stamp, and this is how much time there's been since this route was learned, so this is representative of how long this device has known about this route right here. So there's some information that you would see for each one of these routes within the routing table.
There are three different types of networks that you'll see. One of them is a directly connected network. Directly connected networks are all of those networks that are directly connected. So for this switch one, we have one directly connected network between the router and the switch, and then all of the VLANs that are part of this switch are also directly connected. Or for this router right here, these two on each side of it would be a directly connected network.
Next you have a remote network. A remote network is something that is not directly connected. So for this switch right here, this would be a remote network, this would be a remote network, and this would be a remote network. So in this example right here it would have three remote networks to it.
And then finally you may have a route that points to the internet, or just in this case right here where we call this a stub route, it's the end of the line essentially. Then this switch points out to this router, and maybe we have just the default route that says if you need to communicate, send it this way. And so that's a default route. It's a catch-all. It's just like a default gateway that you would set on your computer.
You may hear some terminology out there such as child and parent routes. So there's a level 1 route, a level 1 parent route, and a level 2 route. First of all, level 1: if it's a level 1, that is anything that is justified all the way over to the left, any route that comes all the way to the left hand side. So that would be three routes in this example right here. This route, this route and this route all are level ones. So these two are level ones, and then this one right here is a level 1, but it's also a parent route, because it has these child routes to it. And so this would be a level 2 child route.
And this is something we would just see with an IP version 4, and really what it does is it designates anything that's subnetted within here. So any subnetted routes, that's where you're going to see a child and parent route. However, when we get to IPv6, they never had classful routing, and so you don't see that same structure with IPv6.
This is an example of a show IPv6 route command showing the routing table for IPv6, and we can see that it's all at the same level. Right here you see a static route in here for our quad zero, so that's the default route that we have. We still have administrative distance on each one of these, we still have a metric on each one of these, we have the destination network and how to get to that network. So we see all the same components on an IPv6 routing table. It just looks a little differently. It doesn't have child and parent routes.
And then one last call out for a host route. A host route goes to just one specific host. It's anything where you see the network mask is all ones or the prefix is 128. So here's a couple examples of that, where we see 10.1.10.35 4 32, we're specifying a specific host there, and same thing for that IPv6: the prefix size being 128 means that we're doing an exact match. So that is when you would see in a routing table something going directly to a specific host, and not necessarily a range of hosts or a whole network.
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 →