Routers use routing tables to determine the best next hop for each packet based on its destination IP address, forwarding traffic hop by hop until it reaches its target network. This content examines how routing tables work and demonstrates how to view them on both a Windows machine and a Layer 3 switch.
How Routers Use Routing Tables
Routers make a determination of where to route this information, where to route these packets, by using a routing table. Each one of these routers has its own routing table, and within this routing table it specifies information that gets it to the next hop.
As information comes into this router, that router is going to look at the destination IP address, where that packet needs to go to. It's going to cross reference that with the router table and determine what the next hop is. It gets to the next router, and that router does the same thing: it takes a look at that packet, looks at the destination IP address, and determines what the next best hop is. And then this router takes a look at its routing table, realizes that that's a directly connected network, and I'm going to send it into that network so it can get to that server.
I thought it'd be good just to take a glimpse into what these routing tables look like. I've got a Windows machine here. I'm going to open up a command window just by hitting the start button and typing in cmd. I'll hit enter, and all I need to do is a route print. What it's going to do is print out the routing tables. So here we see the IP version 6 routing tables and everything that's in the IP version 6 routing tables, and here we have the IP version 4 routing tables and everything in the IP version 4 routing table.
The other thing I did is I remoted into a router. It's actually a layer 3 switch, but for the purposes of this we're just going to call this a router right now. It does routing, it has routing capabilities. It's a switch that has extra capabilities, so it's a layer three switch.
What we see right here is the routing table. I did the show ip route to bring this up, and it's showing all of the routing tables.
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 →