cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
512
Views
3
Helpful
8
Replies

How Router take routing decision if we have static and dynamic route

If we have a circuit between two routers and have eigrp and static configured, which route do they prefer?

ashishkumar01896_0-1727142452428.png

 

As I know :

  • EIGRP has an administrative distance of 90 for internal routes.
  • Static routes have an administrative distance of 1 by default.

Since a lower administrative distance is preferred, the routers will choose the static route over the EIGRP route.

But in some situation we have configured ebgp neig and default route (0.0.0.0 0.0.0.0 next_hope) as well, technically traffic prefered route to less AD distance but my traffic only go through BGp how static and dynamic protocol work together and how take decisions.

 

 

 

2 Accepted Solutions

Accepted Solutions

Hello @ashishkumar01896 ,

compare

show ip route 0.0.0.0

with show ip route 10.100.145.10

Your default static route is:

>> froute1#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 10.100.145.10

You are using a not directly connected IP next-hop that is resolved by recursion in three effective next-hops that are those shown in the output of show ip route 0.0.0.0:

>> * 10.105.145.59
      Route metric is 0, traffic share count is 1
    10.105.145.57
      Route metric is 0, traffic share count is 1
    10.105.145.9
      Route metric is 0, traffic share count is 1

this static default route is installed in the IP routing table for its lower AD 1 < eBGP AD =20

As a result of this the BGP route for 0.0.0.0/0 has code r that means that the BGP route is valid but it couldn't be installed in the IP routing table because a better route for the same prefix has been provided by another protocol ( in this case static)

>> Network Next Hop Metric LocPrf Weight Path
r> 0.0.0.0 10.100.145.10 0 13683 61001 i

Apart the recursive static route what you see is normal and it is explained by the lower AD wins when comparing the same prefix.

0.0.0.0/0 from static compared to 0.0.0.0/0 from eBGP

prefixes with different prefix lengths are not comparable : for example 172.16.0.0/16 and 172.16.100.0/24 are treated as two different prefixes as they are and they are not compared and both preifixes can be installed in the IP routing table.

Hope to help

Giuseppe

 

 

 

View solution in original post

The router prefer static default route than defualt route via ebgp. 

The next-hop is not direct connect and it reachable via three path.

So I think there is no one link between two router but there is multi link

MHM

View solution in original post

8 Replies 8

You see default route via ebgp or via static in rib?

MHM

Yes I see it.

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.100.145.10    4        13979     228     248        3    0    0 01:14:57        1
froute1#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 10.100.145.10

 

 

     Network          Next Hop            Metric LocPrf Weight Path
r>   0.0.0.0          10.100.145.10                         0 13683 61001 i
*>   10.104.146.54/31 0.0.0.0                  0         32768 i

 

 

There is one route which i see in both static and Bgp routing table 

Share show ip route 0.0.0.0

MHM

route1#sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
  Known via "static", distance 1, metric 0, candidate default path
  Routing Descriptor Blocks:
  * 10.105.145.59
      Route metric is 0, traffic share count is 1
    10.105.145.57
      Route metric is 0, traffic share count is 1
    10.105.145.9
      Route metric is 0, traffic share count is 1
route1#

Hello @ashishkumar01896 ,

compare

show ip route 0.0.0.0

with show ip route 10.100.145.10

Your default static route is:

>> froute1#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 10.100.145.10

You are using a not directly connected IP next-hop that is resolved by recursion in three effective next-hops that are those shown in the output of show ip route 0.0.0.0:

>> * 10.105.145.59
      Route metric is 0, traffic share count is 1
    10.105.145.57
      Route metric is 0, traffic share count is 1
    10.105.145.9
      Route metric is 0, traffic share count is 1

this static default route is installed in the IP routing table for its lower AD 1 < eBGP AD =20

As a result of this the BGP route for 0.0.0.0/0 has code r that means that the BGP route is valid but it couldn't be installed in the IP routing table because a better route for the same prefix has been provided by another protocol ( in this case static)

>> Network Next Hop Metric LocPrf Weight Path
r> 0.0.0.0 10.100.145.10 0 13683 61001 i

Apart the recursive static route what you see is normal and it is explained by the lower AD wins when comparing the same prefix.

0.0.0.0/0 from static compared to 0.0.0.0/0 from eBGP

prefixes with different prefix lengths are not comparable : for example 172.16.0.0/16 and 172.16.100.0/24 are treated as two different prefixes as they are and they are not compared and both preifixes can be installed in the IP routing table.

Hope to help

Giuseppe

 

 

 

The router prefer static default route than defualt route via ebgp. 

The next-hop is not direct connect and it reachable via three path.

So I think there is no one link between two router but there is multi link

MHM

Hello
What are you trying to accomplish?


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card