07-01-2020 12:45 AM
Hi,
Greetings of the Day!
in OSPF if a router receives a route advertisement for same network with two different subnets which one will be chosen to install in the routing table. for an instance the router receives 10.0.0.0/16 and 10.0.0.0/30? kindly explain the selection process.
Scenario 2
if the same router receives 10.0.0.0/30 through RIP in addition to the above ospf advertisements how the selection will happen?
this is not in a real time scenario. this doubt came in while studying the maximum prefix length match for route selection.
thanks.
Solved! Go to Solution.
07-01-2020 03:45 AM - edited 07-01-2020 03:47 AM
process of selecting Best routes in the table is based on the longest prefix match; followed by lowest AD, then metrics
Regards, ML
**Please Rate All Helpful Responses **
07-01-2020 06:18 AM
Hello @faheemshaduli ,
what you see is correct , OSPF being a classless protocol is able to install both prefixes
>> 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.0.0.0/16 [110/2] via 192.168.0.1, 00:14:40, GigabitEthernet0/0
O 10.0.0.0/30 [110/2] via 172.17.10.2, 00:09:19, GigabitEthernet0/1
However, the longest prefix match is used first so for destination 10.0.0.1 or destination 10.0.0.2 R2 will use gi0/1 as exit interface for a packet with destination 10.10.20.5 it will send out gi0/0
This is because a classless routing protocol performs route exchange of subnets WITH their associated subent masks so 10.0.0.0/16 and 10.0.0.0/30 can both be installed in the IP routing table.
Georg's answer was focused on the concept of longest most specific prefix match first.
Hope to help
Giuseppe
07-01-2020 01:02 AM - edited 07-01-2020 01:03 AM
process of selecting Best routes in the table is based on the longest prefix match; followed by lowest AD, then metric I think those steps would be the same for OSPF.
so, /30 is selected among 10.0.0.0/16 and 10.0.0.0/30
if you have both routes with exactly same prefix length, i.e. 10.0.0.0/30 via RIP and 10.0.0.0/30 via OSPF, OSPF wins because of AD 110 is lower then 120.
if OSPF gets 2 routes for 10.0.0.0/30 from 2 different sources (neighbors), metric would determine the best way (exit). if both metrics are the same, OSPF does do equal load balance.
Regards, ML
**Please Rate All Helpful Responses **
07-01-2020 01:11 AM
Hello,
basically, in scenario 1, OSPF will install the more specific route in the routing table. In scenario 2, the OSPF route will be installed, due to the fact that RIP has a higher (120) administrative distance than OSPF (110).
07-01-2020 02:54 AM
@Georg Pauwen Hi Georg,
thanks for the quick reply.
i don't know if i am understanding it wrong but when I tested scenario 1 in GNS3 with three routers
R1->R2->R3
where R2 receives 10.0.0.0/16 from R1 and 10.0.0.0/30 from R3. the routing table of R2 has both the route installed.
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.0.0.0/16 [110/2] via 192.168.0.1, 00:14:40, GigabitEthernet0/0
O 10.0.0.0/30 [110/2] via 172.17.10.2, 00:09:19, GigabitEthernet0/1
please help to get some clarity on this.
Thanks.
07-01-2020 06:18 AM
Hello @faheemshaduli ,
what you see is correct , OSPF being a classless protocol is able to install both prefixes
>> 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.0.0.0/16 [110/2] via 192.168.0.1, 00:14:40, GigabitEthernet0/0
O 10.0.0.0/30 [110/2] via 172.17.10.2, 00:09:19, GigabitEthernet0/1
However, the longest prefix match is used first so for destination 10.0.0.1 or destination 10.0.0.2 R2 will use gi0/1 as exit interface for a packet with destination 10.10.20.5 it will send out gi0/0
This is because a classless routing protocol performs route exchange of subnets WITH their associated subent masks so 10.0.0.0/16 and 10.0.0.0/30 can both be installed in the IP routing table.
Georg's answer was focused on the concept of longest most specific prefix match first.
Hope to help
Giuseppe
07-01-2020 06:29 AM
@Giuseppe Larosa thanks. much appreciated.
07-01-2020 08:57 AM
Hi @Giuseppe Larosa,
thanks for the reply. to make it more clear on "longest prefix match" can you please advise which route will be chosen in the below routing table if a router has to destine a packet to ip address 172.16.32.1.
Eigrp - 172.16.32.0/27
OSPF - 172.16.32.0/19
RIP - 172.16.32.0/24
I believe the answer is EIGRP, but is it chosen based on the longest prefix or administrative distance?
Thanks Regards,
07-01-2020 09:36 AM
07-01-2020 12:16 PM
Hello @faheemshaduli ,
longest prefix match first so yes the answer is EIGRP prefix 172.16.32.0/27 regardless of AD value.
Just to make it clear an EIGRP external route D EX has AD 170 so even if prefix 172.16.32.0/27 was a D EX with D EX AD 170 it would still be chosen as exit path for destination 172.16.32.1.
An EIGRP internal route has AD 90.
However, longest prefix match first then AD then metric if applicable
Hope to help
Giuseppe
07-01-2020 03:45 AM - edited 07-01-2020 03:47 AM
process of selecting Best routes in the table is based on the longest prefix match; followed by lowest AD, then metrics
Regards, ML
**Please Rate All Helpful Responses **
07-01-2020 04:30 AM
@Martin L Hi Martin,
thanks for the response. Actually My doubt is not about selecting the best route from the routeing table. it is about installing route into the table.
Regards,
07-01-2020 01:59 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide