Could you tell me what is the differences between the following Cisco XR commands: distance vs distance ospf/bgp ? I know the basics regarding administrative distance, that sets the priority for the protocol. If administrative distance smaller - higher prio. There are also some default adm distance values for protocols like- static route: 1, ospf: 90 etc... It could be also changed manually from 1-255 value.

That's clear for me. But I don't understand the differences between these commands:

From cisco spec:

distance (OSPF)

To define an administrative distance, use the distance command in the appropriate mode.

distance ospf

To define Open Shortest Path First (OSPF) route administrative distances based on route type, use the distance ospf command

  • They're the same.
    – Ron Trunk
    Jun 12 '17 at 13:22

The first command sets the AD for all routes learned by OSPF. This is basically the traditional AD command, as seen in IOS since they invented dirt.

The second allows you to set different AD's for different types of OSPF routes - so different values for externals vs inter-area vs intra-area. I suppose the idea here is to be able to prefer, say, a route learned within an OSPF area to one learned from IS-IS but to continue to use the IS-IS route if the OSPF route is external (i.e. redistributed in).

I guess it's nice that such a knob exists and I'm sure it can be useful in some circumstances but can't help thinking that it'll all end in tears more times than not. It's been my experience that if the answer to a question is tweaking AD that one is almost always better off asking a different question.

Also - the default AD of OSPF on anything Cisco is 110. EIGRP is 90.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.