cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
849
Views
5
Helpful
11
Replies

Which route will be chosen here?

andrewmorris
Level 1
Level 1

If you have a route to network 192.168.10.0/25 known via Ripv2 and a route to 192.168.10.0/24 known via a static route, which path is preferred, the RIP route or the static route?

I immediately think that the static route should be chosen as it has the lower admin distance, but the fact that the RIPv2 route is more specific is casting a little doubt in my mind.

Please help?

Thanks

Andrew

11 Replies 11

a.awan
Level 4
Level 4

Administrative distance comes into play when the router learns the same route from different routing sources (protocols). In your case 192.168.10.0/25 and 192.168.10.0/24 will be treated as two separate routes by the router and both will be installed in the routing table.

Now the question arises which route will be chosen when a destination address in a packet matches both routes. Just remember that always the longest match is prefered and that will be the /25 and not the /24.

In short the Admin Distance is used when the router learns the same route from two different routing protocols (static or dynamic). The longet prefix match is used to actually forward packets.

Hi There,

Thanks, but that does not answer the question.

In the case above will the RIPv2 route be preferred or the static route.

Your answer above conflicts with each other.

Regards

Andrew

I do not understand what you see as a conflict. While I might use slightly different terms, I think that the explanation from Atif is correct and I do not see a conflict in what he says.

Administrative distance is used when the same prefix is learned from two different sources. In the example you gave 192.168.10.0/25 is learned from RIP with an administrative distance of 120. 192.168.10.0/24 is learned from static with an administrative distance of 1.

These may look like the same route but they are two different prefixes (different mask length). So administrative distance does not come into play. If you do a show ip route you would find both entries are in the table.

To answer your question in a slightly different way, for addresses 192.168.10.0 through 192.168.10.127 the RIP route will be preferred and for addresses 192.168.10.128 through 192.168.10.255 the static route will be preferred.

HTH

Rick

HTH

Rick

He did answer the question:

Both routes are valid and will be installed in the routing table. Traffic destined for 192.168.10.129-254 will be sent according to the static entry, as it is the only match. Traffic destined for 192.168.10.1-126 will be sent according to the RIPv2 entry, as it is a more exact match.

If the routes in question were identical (same bit mask), the static route would be the only one installed in the routing table.

Hope this helps.

Looks like i do not need to defend my answer as both Rick and Ryan have offered self explanatory descriptions.

If it is still not clear then do let us know and we will try to explain it further.

Hi All,

Thanks for all your input. I can see where this is headed and that is that given the two routes above, the more specific route will be chosen and that admin distance will only come into play when the route is exactly the same with the exact subnet mask and offered by two different routing sources, so if the RIPv2 route was 192.168.10.0/25 and the static route was 192.168.10.0/25, then the static route would be chosen and the reason for this would be due to the admin distance of the static route been more preferred than the RIP route.

However, there is one aspect I have to disagree with you on.

Given the RIP route of 192.168.10.0/25 the subnets for this route would be:

192.168.10.0/25

192.168.10.128/25

Right or wrong?

Therefore according to your explanations above, I agree that any route to a device in the range of 192.168.10.1-126 will be routed using the most specific RIPv2 match yet won't the same apply to a destination address in range 192.168.10-129-254 as it will still be more specific than the static route?

Thanks for all your help and patience with this by the way.I just want to understand this clearly.

Andrew

192.168.10.0/25 IS the subnet for which you are routing via RIP. The 192.168.10.128/25 subnet is NOT included in that route. This is where the static route comes into play.

bcbv

Given the RIP route of 192.168.10.0/25 the subnets for this route would be:

192.168.10.0/25

192.168.10.128/25

Right or wrong?

The RIP route does suggest that there are two subnets in the class C network. However in your original example there was one RIP route 192.168.10.0/25. Where are you getting the 192.168.10.128/25 from?

As per your original question and the following discussion the routing table would have two entries 192.168.10.0/25 and 192.168.10.0/24.

The practical effect is that 192.168.10.0 through 192.168.10.127 would be routed according to the RIP route and 192.168.10.128 through 192.168.10.255 would be routed according to the static route.

HTH

Rick

HTH

Rick

Thanks Rick,

Now...if we had the following situation:

192.168.10.0/25 - known via RIPv2

192.168.10.128/25 - known via RIPv2

192.168.10.0/24 - known via static

To route to a device 192.168.10.176, would the RIPv2 route be preferred as it is the more specific route?

Regards

Andrew

That's correct.

Thanks