Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

static vs OSPF

hi friends,

I have one doubt about preferred route between static and ospf.

if there is routes

static : 0.0.0.0/0 / 0.0.0.0 next-hop 10.8.2.2

OSPF: 10.8.10.0/24 next 10.8.2.2

then which route will be preferred and on what basis.

Is MASK is one of the criteria?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Silver

Re: static vs OSPF

The longest match rule would apply here, so yes the Mask on the route is taken into account. Anything that would be within the 10.8.10.0 network would take your OSPF route. Anything outside of this network space would take your 0/0 route (static).

If the routes were the same (ie Static route to 10.8.10.0/24) then the static would be taken based on better admin distance.

Hope this helps you,

Don

New Member

Re: static vs OSPF

The router should look for the longest bit match first, which would be the OSPF route. the 0.0.0.0 0.0.0.0 route is the default route and is used if there is no other match in the routing table.

2 REPLIES
Silver

Re: static vs OSPF

The longest match rule would apply here, so yes the Mask on the route is taken into account. Anything that would be within the 10.8.10.0 network would take your OSPF route. Anything outside of this network space would take your 0/0 route (static).

If the routes were the same (ie Static route to 10.8.10.0/24) then the static would be taken based on better admin distance.

Hope this helps you,

Don

New Member

Re: static vs OSPF

The router should look for the longest bit match first, which would be the OSPF route. the 0.0.0.0 0.0.0.0 route is the default route and is used if there is no other match in the routing table.

220
Views
0
Helpful
2
Replies
CreatePlease login to create content