cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3227
Views
0
Helpful
11
Replies

OSPF AD

Mihai Ciuraru
Level 1
Level 1

Hello guys,

This is my first post around here, so be gentle.

I'm playing around with OSPF and I've come across a thing that I cannot explain.

Setup:

A router that receives a network from two places:

R5(config-router)#do sh ip route 155.1.67.0
Routing entry for 155.1.67.0/24
  Known via "ospf 1", distance 110, metric 66, type inter area
  Last update from 155.1.0.3 on Serial0/0, 00:00:16 ago
  Routing Descriptor Blocks:
    155.1.0.3, from 150.1.3.3, 00:00:16 ago, via Serial0/0
      Route metric is 66, traffic share count is 1
  * 155.1.0.1, from 150.1.6.6, 00:00:16 ago, via Serial0/0
      Route metric is 66, traffic share count is 1

What I'm trying to do is modify the AD for the route comming from 150.1.6.6 so that it doesn't get installed into the routing table:

router ospf 1
log-adjacency-changes

distance 250 150.1.6.6 0.0.0.0 67

!

access-list 67 permit 155.1.67.0

If I look at the routing table after I apply the config I get:

O IA    155.1.67.0/24 [110/66] via 155.1.0.3, 00:12:24, Serial0/0
                                [110/66] via 155.1.0.1, 00:12:24, Serial0/0

If I look at the "debug ip routing" output:

*Mar  1 04:04:16.198: RT: add 155.1.67.0/24 via 155.1.0.1, ospf metric [250/66]
*Mar  1 04:04:16.198: RT: NET-RED 155.1.67.0/24
*Mar  1 04:04:16.198: RT: add 155.1.67.0/24 via 155.1.0.3, ospf metric [110/66]
*Mar  1 04:04:16.198: RT: NET-RED 155.1.67.0/24

If I change the config for ospf with the AD of 255

router ospf 1
log-adjacency-changes

distance 255 150.1.6.6 0.0.0.0 67

!

access-list 67 permit 155.1.67.0

The route to 150.1.6.6 does not get installed and the "debug ip routing" is:

*Mar  1 04:20:00.510: RT: add 155.1.67.0/24 via 155.1.0.3, ospf metric [110/66]
*Mar  1 04:20:00.510: RT: NET-RED 155.1.67.0/24

Does anyone know what is going on? Why does the AD gets changed for the max value (255), but not for a smaller one.

Thanks,

Mihai

1 Accepted Solution

Accepted Solutions

When I try to manipulate AD it changes it for both routes.

O IA    4.4.4.0 [200/21] via 13.13.13.3, 00:00:51, FastEthernet0/1

                [200/21] via 12.12.12.2, 00:00:51, FastEthernet0/0

If I set AD to 255 then it is removed like it was for you as well.

     4.0.0.0/24 is subnetted, 1 subnets

O IA    4.4.4.0 [110/21] via 13.13.13.3, 00:00:02, FastEthernet0/1

If I then add another distance command then it works.

4.0.0.0/24 is subnetted, 1 subnets

O IA    4.4.4.0 [200/21] via 13.13.13.3, 00:00:02, FastEthernet0/1

Then if I remove the distance 255 command it does not work at all.

O IA    4.4.4.0 [110/21] via 13.13.13.3, 00:00:02, FastEthernet0/1

                [110/21] via 12.12.12.2, 00:00:02, FastEthernet0/0

So this feature does not seem to work reliably. If we look in LSDB:

R1#sh ip ospf data sum 4.4.4.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA

  LS age: 1392

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 2.2.2.2

  LS Seq Number: 80000002

  Checksum: 0x29F3

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

  Routing Bit Set on this LSA

  LS age: 1354

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 3.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xB0E

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

The one via 2.2.2.2 is older. Let's try to make the one to 3.3.3.3 older and then set distance.

R2#clear ip ospf proc

Reset ALL OSPF processes? [no]: yes

R1#sh ip ospf data sum 4.4.4.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA

  LS age: 26

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 2.2.2.2

  LS Seq Number: 80000003

  Checksum: 0x27F4

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

  Routing Bit Set on this LSA

  LS age: 1569

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 3.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xB0E

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

R1(config-router)#do sh run | s router ospf

router ospf 1

router-id 1.1.1.1

log-adjacency-changes

distance 200 2.2.2.2 0.0.0.0 1

R1(config-router)#no distance 200 2.2.2.2 0.0.0.0 1

R1(config-router)#distance 200 3.3.3.3 0.0.0.0 1

R1(config-router)#^Z

R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     4.0.0.0/24 is subnetted, 1 subnets

O IA    4.4.4.0 [200/21] via 13.13.13.3, 00:00:03, FastEthernet0/1

                [200/21] via 12.12.12.2, 00:00:03, FastEthernet0/0

So it seems it only works for the oldest instance of the LSA but then it changes for both neighbors anyway. So I can't get the feature to work reliably on

R1#sh ver | i IOS

Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(15)T10, RELEASE SOFTWARE (fc3)

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

View solution in original post

11 Replies 11

WILLIAM STEGMAN
Level 4
Level 4

Hi Mihai.  Is 150.1.6.6 the address desginated as the router ID of the OSPF neighbor?

When you use the 'distance' command with OSPF and specify a specific OSPF neighbor, the IP address that you specify for the next-hop needs to be the RID of the neighbor. Give that a try, and let us know if it' successfull.

William,

Yes, 150.1.6.6 is the router ID of one of the neighbours.

R5 - 150.1.5.5 - this is the router on witch I'm doing the configuration

R6 - 150.1.6.6

R3 - 150.1.3.3

In you distance command, try changing your subnet mask to /24.  It's seems odd, but I found some similar behavior at this post.

https://learningnetwork.cisco.com/thread/8963

Hello,

I think that changing the AD per prefix received via one neighbor will not be possible in this case. I have done a couple of tests with IOS 15.0(1)M and for IA prefixes it works but just for all of them, I mean if you apply the distance command to the RID of one of the neighbors it will work for both prefixes, or it will not work at all. In the test I have done I have changed the AD for 1 prefix applied for one neighbor and it did not work as in your case. However, when I applied the same command to the other neighbor it worked but changing the distance for both prefixes:

O IA     10.1.23.0/24 [199/20] via 10.1.123.3, 00:04:35, Ethernet1/0

                      [199/20] via 10.1.123.2, 00:03:39, Ethernet1/0

I think that the way IOS choose this is the most recent router LSA of the ABR that injected the LSA Type 3's in Area 0 as I did a clear ip process several times and it is the behavior I saw, but I can be wrong.

Best Regards,

Jose.

In my case the routes are not comming from one neighbour, one is 150.1.1.1 and the other is 150.1.6.6 and the setup works only if I try to change the AD to 255, then one route is placed with 110 and the other gets 255 and doesn't show up in the routing table.

I've tried another thing and this only confuses me more, I've tried to change the AD value for the other router (150.1.3.3)

router ospf 1
log-adjacency-changes
distance 250 150.1.3.3 0.0.0.0 67

And I get this:

O IA    155.1.67.0/24 [250/66] via 155.1.0.3, 00:00:07, Serial0/0
                                 [250/66] via 155.1.0.1, 00:00:07, Serial0/0

Can you draw a topology so we can recreate the scenario please. Is this the INE topology? If it is, which lab?

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

It is the INE vol I lab (exercise 6.39)

When I try to manipulate AD it changes it for both routes.

O IA    4.4.4.0 [200/21] via 13.13.13.3, 00:00:51, FastEthernet0/1

                [200/21] via 12.12.12.2, 00:00:51, FastEthernet0/0

If I set AD to 255 then it is removed like it was for you as well.

     4.0.0.0/24 is subnetted, 1 subnets

O IA    4.4.4.0 [110/21] via 13.13.13.3, 00:00:02, FastEthernet0/1

If I then add another distance command then it works.

4.0.0.0/24 is subnetted, 1 subnets

O IA    4.4.4.0 [200/21] via 13.13.13.3, 00:00:02, FastEthernet0/1

Then if I remove the distance 255 command it does not work at all.

O IA    4.4.4.0 [110/21] via 13.13.13.3, 00:00:02, FastEthernet0/1

                [110/21] via 12.12.12.2, 00:00:02, FastEthernet0/0

So this feature does not seem to work reliably. If we look in LSDB:

R1#sh ip ospf data sum 4.4.4.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA

  LS age: 1392

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 2.2.2.2

  LS Seq Number: 80000002

  Checksum: 0x29F3

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

  Routing Bit Set on this LSA

  LS age: 1354

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 3.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xB0E

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

The one via 2.2.2.2 is older. Let's try to make the one to 3.3.3.3 older and then set distance.

R2#clear ip ospf proc

Reset ALL OSPF processes? [no]: yes

R1#sh ip ospf data sum 4.4.4.0

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA

  LS age: 26

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 2.2.2.2

  LS Seq Number: 80000003

  Checksum: 0x27F4

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

  Routing Bit Set on this LSA

  LS age: 1569

  Options: (No TOS-capability, DC, Upward)

  LS Type: Summary Links(Network)

  Link State ID: 4.4.4.0 (summary Network Number)

  Advertising Router: 3.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xB0E

  Length: 28

  Network Mask: /24

        TOS: 0  Metric: 11

R1(config-router)#do sh run | s router ospf

router ospf 1

router-id 1.1.1.1

log-adjacency-changes

distance 200 2.2.2.2 0.0.0.0 1

R1(config-router)#no distance 200 2.2.2.2 0.0.0.0 1

R1(config-router)#distance 200 3.3.3.3 0.0.0.0 1

R1(config-router)#^Z

R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     4.0.0.0/24 is subnetted, 1 subnets

O IA    4.4.4.0 [200/21] via 13.13.13.3, 00:00:03, FastEthernet0/1

                [200/21] via 12.12.12.2, 00:00:03, FastEthernet0/0

So it seems it only works for the oldest instance of the LSA but then it changes for both neighbors anyway. So I can't get the feature to work reliably on

R1#sh ver | i IOS

Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(15)T10, RELEASE SOFTWARE (fc3)

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

Daniel, thanks for taking the time to check this out, it seemed a bit weird to me too but I tought mabey I've missed something in the config.

Thanks for the suggestion, I've tried it but got the same result.

Review Cisco Networking for a $25 gift card