Answer: Overlapping Connected and Routing Protocol Routes
This post wraps up the #CCNA Q&A focused on how routers add routes to their routing tables. What happens when a router happens to learn three separate routes for the same subnet ID – but with different masks? And how does yet another overlapping subnet – same subnet ID, different mask – affect the router’s logic, if that route is that special type of route for a connected subnet? Today’s post walks through the answer to the question and the reasons.
(Same disclaimer as the previous question!) First, for emphasis, the design used for this question is poor and not recommended. I just used it as a way to make one router receive routing updates for three subnets that have the same subnet ID but different masks, as learned with three different routing protocols, just as an exercise. Don’t use a similar design in a real network! The goal of the question is to let us focus on how a router thinks about adding routes to its IP routing table.
Compared to the previous question and answer, this question just adds a connected route for subnet 10.1.2.0/24, to the other three learned routes. This additional route begs the question: does a connected route somehow change the rules a router uses when choosing what routes to add to the routing table? The short answer: no.
To review, a router must think about how to choose amongst competing routes to the same subnet. The subnet is not considered the “same subnet” unless both the subnet ID and mask are the same. In this question, and the previous question, none of the subnets were the same subnet! As a result, the router never had to use any logic to decide which of the multiple routes to the same subnet was better, because the router knew of only one route to each individual subnet.
The Correct Answer
The correct answer, F, states that the router will add routes to all four subnets. None of the subnets – including the connected subnet – is the exact same subnet. So, the router simply adds routes for each.
If you’re already thinking this, great! But what would have happened if the question had made all four of those subnets use the same mask? If that were the case:
- All four subnets would appear to be the same subnet: the same subnet ID and same mask.
- The router would have to choose between all four competing routes
- The router would use the administrative distance of the route to choose the best route, so the connected route would win.