Routers populate their routing tables through three methods: connected interface routes, manually configured static routes, and dynamically learned routes via routing protocols. This content covers how each method works and when to use it.
Router Route Learning
Somehow these routers need to learn about these different routes to these different networks so it can put it on the routing table. Essentially there are three different ways that that can happen. The first way we've already talked about: when you configure an interface on a network and that interface comes up, then it will put that into the routing table. Another method of doing that is by establishing a route using a static route, by actually entering it into the machine. And finally, there are some dynamic routing protocols that will help this router automatically learn of those routes.
So how do these routers learn of these remote networks?
For one, a router can have static routes set up in it. What a static route is, is an entry that you manually set up onto the router. You go and manually set up a route, and that is a static route. We call it a static route because it doesn't change. It's not dynamic at all.
We could go into this router and we could specify this network right here, and we could specify how to get there, which would be the next hop pointing to this router right here. We may specify an IP address that is on that router, that next hop router, or we may specify an exit interface. So then what we'd do is specify that, so that when it sees a packet that's coming through that's destined for this remote network, then it would take that static route to take that next hop.
But there is another way as well, and that is through a dynamic routing protocol. A dynamic routing protocol is a way for routers to share information about the networks that they're connected to. Here we have several routers here with routing tables. What they would do is share the information from their routing tables back and forth between these routers. So this router would then learn about these distant networks, possibly this remote network and possibly these remote networks, so that it could get to those destinations by one of the routes that it has available to it. In this case right here, this router would learn that this remote network is accessible either through going through this router right here or going through this router right here. That's done with a dynamic routing protocol. So these dynamic routes will be learned from a dynamic routing protocol.
This does two things for us. One is that with a larger, more complex network, we don't have to sit there and manually enter a bunch of static routes onto our routers, so it really saves us a lot of time. Another thing is that because it's dynamic, if something happens — like let's say a link goes down — then the router will know how to adjust and get to that remote location even though there's a downed link somewhere in between. That is how dynamic routing protocols work.
Some examples of that might be RIP or OSPF or EIGRP. Those are some routing protocols that you would set up on every single router that you would want to participate, and then that would start a communication back and forth between these routers to share these different routes.
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 →