Troubleshooting Metric Redistribution

Hello Tristan

It’s great to hear that you find the lesson helpful! Thanks for your feedback. The AD fix is indeed a somewhat cleaner solution but the tagging solution essentially has the same results. It’s really up to what you feel more comfortable with. In any case, comprehending the solutions is the most important thing at this stage… If you have any questions, you can always post them on the forum!

Thanks for your feedback!

Laz

Hi Team,

Can you please explain why it used “any connection” option?

That’s the example for the AD manipulation.

(config)#router ospf 1
(config-router)#distance 255 0.0.0.0 255.255.255.255 LOOPBACK_R1

Best Regards,
Martin

Hello Martin.

Take a look at this topology:

Each router is connected to the multi-access segment and is advertising a loopback IP that is relevant to their router number (for ex: R1 - 1.1.1.1/32).

R1#show ip route ospf | begin Gateway  
Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 192.168.1.2, 00:00:44, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.1.3, 00:00:34, GigabitEthernet0/0
R1#

We can see that the default OSPF AD is 110. We can change the AD by using the distance command.

R1(config)#router ospf 1      
R1(config-router)#distance 111
R1(config-router)#do show ip route ospf | begin Gateway
Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [111/2] via 192.168.1.2, 00:00:43, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [111/2] via 192.168.1.3, 00:00:43, GigabitEthernet0/0
R1(config-router)#

Now the AD is set to 111 for all routes. What you can optionally enter is the router for whose routes you want to change the AD. For example,

R1(config-router)#distance 55 2.2.2.2 0.0.0.0
R1(config-router)#do show ip route ospf | begin Gateway
Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [55/2] via 192.168.1.2, 00:00:09, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.1.3, 00:00:09, GigabitEthernet0/0
R1(config-router)#

distance 55 2.2.2.2 0.0.0.0 will set the AD to 55 for any routes advertised by R2 (you enter the RID of the router here). You can also specify and modify the wildcard mask to match more routers, it’s like general OSPF network/ACL logic.

So what Rene’s example is saying is:

Set the AD to 255
distance 255
For any neighbor/any router that advertises the network
0.0.0.0 255.255.255.255
But only for networks matched by LOOPBACK_R1
LOOPBACK_R1

distance 255 0.0.0.0 255.255.255.255 LOOPBACK_R1

If you need any further help, let me know.
David

2 Likes

Hi David,

I was wondering if there is more to it – so it’s just like catch all scenario for the route we are filtering? Instead of being explicit and doing two commands for the two neighbors?

Thanks,
Martin

Hello Martin.

With the distance command, you can be as specific as you want or as least specific as possible. So yes, you can either match every single router by using 0.0.0.0 255.255.255.255 or you can be specific and do something like this:

R1(config)#router ospf 1
R1(config-router)#distance 99 2.2.2.2 0.0.0.0
R1(config-router)#distance 99 3.3.3.3 0.0.0.0
R1(config-router)#do show ip route ospf | begin Gateway
Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [99/2] via 192.168.1.2, 00:00:03, GigabitEthernet0/0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [99/2] via 192.168.1.3, 00:00:03, GigabitEthernet0/0
R1(config-router)#

The command is really flexible. You can decide to use or not use any wildcards at all, you can optionally specify or not specify a route-map and so it goes on :smiley:

David

1 Like

Hello Martin

In addition to @davidilles excellent responses, take a look at this Cisco command reference as well…

Laz

1 Like

Great feedback, thanks to both of you :slight_smile:

Regards,
Martin

2 Likes