Categories R&S

OSPF – Implement and troubleshoot path preference – Per neighbor cost

Let’s look at another way to influence path preference with OSPF.

 

Theory:

 

Because OSPF cost calculation for a segment is based on the bandwidth value of the outgoing interface, in certain topology, there can be some issues when changing the cost or the bandwidth of the interface.

In our topology, if we want to influence the path from R10 to R4’s loopback, we won’t be able to do it by changing the cost on R10 interface.

 

Requirements :

 

Make sure traffic from R10 to R4’s loopback goes via R9.

 

Diagram:

OSPF cost

 

Configuration and verification:

 

First let’s check how traffic is route from R10 to R4:

R10#sh ip route 4.4.4.4
Routing entry for 4.4.4.4/32
  Known via "ospf 10", distance 110, metric 13, type inter area
  Last update from 10.10.3.8 on Ethernet0/0, 00:14:41 ago
  Routing Descriptor Blocks:
  * 10.10.3.8, from 22.22.22.22, 00:14:41 ago, via Ethernet0/0
      Route metric is 13, traffic share count is 1
R10#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
  1 10.10.3.8 1 msec 0 msec 0 msec
  2 10.10.18.1 0 msec 2 msec 0 msec
  3 10.10.14.2 1 msec 2 msec *
R10#sh ip ospf data sum 4.4.4.4

            OSPF Router with ID (100.100.100.100) (Process ID 10)

                Summary Net Link States (Area 3)

  LS age: 1105
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 4.4.4.4 (summary Network Number)
  Advertising Router: 11.11.11.11
  LS Seq Number: 80000001
  Checksum: 0x9965
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 2

  LS age: 1069
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 4.4.4.4 (summary Network Number)
  Advertising Router: 33.33.33.33
  LS Seq Number: 80000001
  Checksum: 0xD98
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 3

 

As we can see it goes to R8, then R1 and finally R4.

 

Now we change the cost per neighbor under R10 OSPF process:

R10(config)#router ospf 10
R10(config-router)#neigh 88.88.88.88 cost 10
R10(config-router)#neigh 99.99.99.99 cost 5
R10(config-router)#end

 

And it doesn’t work even after clearing the OSPF process:

R10#sh ip route 4.4.4.4
Routing entry for 4.4.4.4/32
  Known via "ospf 10", distance 110, metric 13, type inter area
  Last update from 10.10.3.8 on Ethernet0/0, 00:01:04 ago
  Routing Descriptor Blocks:
  * 10.10.3.8, from 22.22.22.22, 00:01:04 ago, via Ethernet0/0
      Route metric is 13, traffic share count is 1

 

I changed the OSPF network type to point-to-multipoint non broadcast but still can’t get it.

The “ip ospf neigh det” command doesn’t give me more info about the cost.

 

Ok, I finally found out that the “neighbor X.X.X.X cost Y” command have to be applied to the neighbor interface IP address and not the OSPF router-ID…

 

After applying the cost using the correct IP address, I get the following:

R10(config-router)#neigh 10.10.3.8 cost 1000
R10(config-router)#neigh 10.10.3.9 cost 1

R10#sh ip route 4.4.4.4
Routing entry for 4.4.4.4/32
  Known via "ospf 10", distance 110, metric 14, type inter area
  Last update from 10.10.3.9 on Ethernet0/0, 00:00:09 ago
  Routing Descriptor Blocks:
  * 10.10.3.9, from 22.22.22.22, 00:00:09 ago, via Ethernet0/0
      Route metric is 14, traffic share count is 1
R10#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
  1 10.10.3.9 1 msec 1 msec 0 msec
  2 10.10.39.1 1 msec 2 msec 1 msec
  3 10.10.1.1 1 msec 1 msec 1 msec
  4 10.10.14.2 1 msec 1 msec *

R10#sh ip ospf neigh 99.99.99.99 det
 Neighbor 99.99.99.99, interface address 10.10.3.9
    In the area 3 via interface Ethernet0/0
    Neighbor priority is 0 (configured 0), State is FULL, 6 state changes, Cost in topology Base with MTID 0 is 1

R10#sh ip ospf neigh 88.88.88.88 det
 Neighbor 88.88.88.88, interface address 10.10.3.8
    In the area 3 via interface Ethernet0/0
    Neighbor priority is 0 (configured 0), State is FULL, 6 state changes, Cost in topology Base with MTID 0 is 1000

 

When looking at the command reference it says neighbor [ip-address] so I guess you cannot use the neighbor ID…

 

Thank you for reading.

 

OSPF – Implement and troubleshoot path preference – Per neighbor cost