A network administrator has many options for configuring and maintaining the routing table between layer 3 devices. In this video, you’ll learn about static routing, dynamic routing, and default routes.
<< Previous Video: Switch Interface Properties Next: IGP and EGP >>
If you’re watching this video on the internet, then the packets that are containing this video content are hopping through a number of different routers to get to your workstation. These routers make forwarding decisions based on what the destination IP addresses contain within those packets. Each router only knows what the next step is to be able to get the packet along its way. There’s a list of these next steps contained within every single router, and this is called a routing table.
Let’s take the example of Sam that’s sending an IP packet to Jack. There are a number of different routers between both of these networks. Sam sends the IP packet to her default router. This router is going to look at the destination IP address that is contained within this packet, and it’s going to compare that IP address to a list of routes that are contained within its routing table. When it determines where the next step is going to be, it sends that packet out the next hop.
The same process occurs on the next router down the line. The routing table is referenced, and the packet is sent out the appropriate interface. And finally on the last router, the same thing occurs, and the packet is sent on to the interface that will get it closest to Jack’s machine.
One way to define this list of available routes in the routing table is for the network administrator to administratively add them to the routing table manually. We call this static routing. And the administrator of this router is the one that will determine what routing decisions are made and where traffic flows as it goes through this router.
If you have a relatively small or simple network, it may be easier to have everything statically routed. You don’t have to worry about running any dynamic routing protocols, and there’s no additional overhead of routing protocols taking up CPU and bandwidth on the network. This is commonly done at remote sites where there’s only one way to send data so you would commonly add a single static route onto that router. You might also consider static routing to be more secure because a dynamic routing protocol is not able to make changes to the way that traffic is forwarded through your router.
But static routes may be more difficult to administer, especially on networks that are larger and have many more routes associated with them. It’s very easy to make a mistake and accidentally configure a routing loop on a very large network like that. If there is a change to the network and one of those links happens to go down, you as the administrator would have to log into that router and manually reconfigure the static route.
When you’re working with routing tables, you have to interpret that routing table from the perspective of that individual router. Let’s look at this network configuration where we have Sam, Jack, and Teal’c on this particular network configuration. And they’re separated from each other by three individual routers.
Let’s look at only Router 1 for this particular static routing example. We know that Router 1 is directly connected to the 10.10.10.0/24 network, that’s the one here, where you’ve got a direct connection to the 10.10.40.0 network, that’s the one listed here. And we’re directly connected to the 10.10.50.0 network, and that’s the one down here on the bottom.
If Sam needs to send any traffic to Jack, we’re going to need a route inside of Router 1 that will allow that communication. So we need to add a route to 10.10.20.0/24. And we’ll tell Router 1 if you need to get to that network, you need to send all of that traffic to 10.10.40.2.
Let’s add another static route that will allow us to send traffic down to Teal’c’s network. We’ll add another routing entry for 10.10.10.30.0, because that’s the network that Teal’c is on. And we’ll say to get to that network, we need to send all of that traffic to 10.10.50.2, which is the interface on Router 3.
That was a good bit of configuration just to add two additional static routes into this router. Wouldn’t it be nice if this entire process was handled automatically and you wouldn’t have to add any routes at all? You can do that by using dynamic routing. This is when the routers will send updates to each other, and if there’s any changes to the network, it will update those routing tables in just a matter of seconds so that all of the routers know exactly how to send traffic across the network.
This means that we don’t have to perform any manual configurations of the routes. If there are any new routes that suddenly appear, they will automatically be added to all of the other routers in our environment. And it will be able to scale as we add more and more routers to our infrastructure.
Dynamic routing does have some disadvantages. It’s using some bandwidth to be able to send these updates between the routers. And there’s memory and CPU that’s used inside of the router to store this information. There’s also some initial configuration that has to take place to be able to send these dynamic routes between all of the different routers.
Here is the exact same network. We still have Sam and Jack and Teal’c. And we’re still looking at the routes from the perspective of Router 1. We have all of the connected routes that are automatically added to every routing table, but now we need to have the routes added so that we can communicate to the 10.10.20 network and the 10.10.30 network.
With a dynamic routing protocol, the remote routers will send routing updates to all of the other routers on the network. And when those router updates are received, the information is automatically added to the routing table. Same thing will occur as the routing update comes from Router 3 to Router 1. And Router 1 will automatically update its routing table automatically using this dynamic routing protocol.
There’s a special kind of static route called a default route. This is a route that you configure inside the router that says, if nothing else matches inside of our routing table, send the traffic this way. You might also see this referred to as the gateway of last resort. A default route is a very common configuration to put at something like a remote site where there’s only one way to send traffic out and one way to send traffic in.
This means the router really doesn’t have to make any decision about forwarding traffic. If traffic’s coming from the inside, it sends the traffic to the outside. If traffic is coming from the outside, it since the traffic into the inside. And that’s exactly the scenario that we would commonly use a default route with.
If you have a network that has a number of internal routes and a lot of external routes, this could also simplify the process of building your routing table. Instead of listing out all of the external routes, you could simply add a default route and send all of the traffic external whenever it did match anything on the inside.
The network diagram we used before is a very good example of how a default route may work. We might want to look at Jack’s network where there’s only one way out and one way in. In this particular scenario, it would be perfect to add a default route into Router 2 that said if there’s any traffic coming inbound that needs to go out, simply send it down to the next hop at 10.10.40.1. And if Jack does send traffic to that router, the router simply looks at the default route and sends the traffic on its way.