cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1261
Views
0
Helpful
1
Replies

distance command not working

I have the following network (it is one one of the CBT Nugget labs):

distribute question.png

Redistribution is taking place from OSPF to EIGRP and vica versa. Route tagging is preventing potential redistribution loops.

Currently R2's preferred route to 10.1.0.0/24 is across the 10.1.12.0/24 link. This is expected. Its alternate route through R3 has an AD of 170 for external EIGRP routes as opposed to its OSPF route which has an AD of 110.

The lab calls for the prefered route to 10.1.0.0/24 (from the EIGRP domain) go through R3. I wish to do this by changing the AD for 10.1.0.0/24 route that R2 gets from R3 to 105.

I am using the following commands on R2:

access-list 1 permit 10.1.0.0 0.0.0.255

router eigrp 100

distance 105 10.1.23.3 0.0.0.0 1

My understand is that the distance command works as follows:

distance <AD>  <IP & wildcard of router(s) that you are getting the routes from>  <acl that will match the routes you wish to affect>

Hence my commands above states " any routes you get from 10.1.23.3 (R3) that match acl 1 (which matches 10.1.0.0/24) give an AD of 105"

However this is not working. The ACL is getting matches but the AD is not changing. Even if I shutdown R2's OSPF interface, the external EIGRP route through R3 is now prefered but the AD is still 170.

Am I using this command incorrectly. Can anyone help?

1 Reply 1

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Steven,

to understand why the command didn't worked we should first of all see the EIGRP route

So a starting point is on R2

show ip eigrp topology 10.0.1.0

And what is the output of show ip route 10.0.1.0 when R2 interface to OSPF domain is disabled?

Being an EIGRP external route we should consider the IP next-hop in the route data structure or the IP address of the originating router that is also present?

The originating router is the EIGRP router-id of R3, the IP next-hop should be the one you have specified.

Considering alternative ways to achieve the lab target.

you may want to consider the distance eigrp command that allow to change the AD of EIGRP internal routes and of EIGRP external routes.

something like:

router eigrp 100

distance eigrp 90 105

see

http://www.cisco.com/en/US/docs/ios-xml/ios/iproute_eigrp/command/ire-a1.html#GUID-4DA7B4F1-1503-41E3-8E9F-AC2CEAC325F1

However, this will make all EIGRP external routes preferred over OSPF routes on R2. And this may be beyond your lab objectives.

In any case if R2 installs the EIGRP route from R3 it will stop to redistribute the network 10.0.1.0 from OSPF To EIGRP.

A tricky request may need a tricky solution a distribute-list inbound in OSPF process on R2 denying 10.0.1.0/24 could provide the desired result.

The route is redistributed if it is present on the OSPF database AND installed in the IP routing table, the use of the distribute-list removes the route from the IP routing table.

Final note:

in real world a requirement like this is really unlikely both R2 and R3 are to be used as points of mutual redistribution between the EIGRP and the OSPF domains.

Hope to help

Giuseppe

Review Cisco Networking products for a $25 gift card