Octet

Traffic takes the wrong path through your OSPF network. How do you steer it?

Show the answer

Say this first

First check the costs along both paths with show ip ospf interface brief and the route metric. Then set ip ospf cost on the interfaces that should be less attractive, on the router where the traffic leaves, in both directions if the return path matters. Fix a wrong reference bandwidth before adding manual costs.

Go deeper

Cost is outbound

The cost of a link counts in the direction the router sends traffic. To make R1 avoid a link, raise the cost on R1's interface. To make the return traffic avoid it too, raise it on the far end as well.

Tools, from cleanest to bluntest

  1. Reference bandwidth set right everywhere, so speed is reflected automatically.
  2. ip ospf cost <1-65535> on specific interfaces. Overrides the calculation, affects only OSPF.
  3. bandwidth on the interface. Changes the calculation but also EIGRP and QoS. Avoid for this.
  4. Area design. Intra-area beats inter-area regardless of cost, so a link in the wrong area wins anyway.

Check

Output
R1# show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     0               1.1.1.1/32         1     LOOP  0/0
Gi0/0/1      1     0               10.0.13.1/30       100   P2P   1/1
Gi0/0/0      1     0               10.0.12.1/30       10    P2P   1/1

Traps

  • Changing cost only on one end and expecting symmetric traffic.
How did you do?