Search This Blog

Thursday, November 4, 2010

OSPF Autocost

Using the following Lab i will demonstrate the use of Autocost.


Links A,B and C are all Giga-Ethernet interfaces while link D is Fast-Ethernet. The default cost calculation, by Cisco, is:

Cost = Reference Bandwidth \ Interface Bandwidth

Reference Bandwidth is an number which set by Cisco to 100,000,000.

Following this formula all links are stated with cost of 1 and by that R4 sees 2 equal cost paths to R1 and vice verse:

R4#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


1.0.0.0/32 is subnetted, 1 subnets

O 1.1.1.1 [110/3] via 10.1.34.3, 00:00:08, GigabitEthernet1/0

[110/3] via 10.1.24.2, 00:00:08, FastEthernet2/0

2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/2] via 10.1.24.2, 00:00:08, FastEthernet2/0

C 192.168.44.0/24 is directly connected, Loopback2

3.0.0.0/24 is subnetted, 1 subnets

O 3.3.3.0 [110/2] via 10.1.34.3, 00:00:08, GigabitEthernet1/0

4.0.0.0/24 is subnetted, 1 subnets

C 4.4.4.0 is directly connected, Loopback0

O 192.168.11.0/24 [110/3] via 10.1.34.3, 00:00:08, GigabitEthernet1/0

[110/3] via 10.1.24.2, 00:00:08, FastEthernet2/0

C 192.168.4.0/24 is directly connected, Loopback1

10.0.0.0/24 is subnetted, 5 subnets

O 10.1.13.0 [110/2] via 10.1.34.3, 00:00:10, GigabitEthernet1/0

O 10.1.12.0 [110/2] via 10.1.24.2, 00:00:10, FastEthernet2/0

C 10.1.24.0 is directly connected, FastEthernet2/0

O 10.1.23.0 [110/2] via 10.1.24.2, 00:00:10, FastEthernet2/0

C 10.1.34.0 is directly connected, GigabitEthernet1/0

O 192.168.1.0/24 [110/3] via 10.1.34.3, 00:00:10, GigabitEthernet1/0

[110/3] via 10.1.24.2, 00:00:10, FastEthernet2/0

but in real these two paths are not equal! Path B+C are both GE while links A+D are FE and GE interfaces which gives less bandwidth and speed.

So we will need to configure autocost on every router in the AS in order to change the reference bandwidth in all:

R2(config-router)#auto-cost reference-bandwidth 1000

% OSPF: Reference bandwidth is changed.

Please ensure reference bandwidth is consistent across all routers.

The reference bandwidth is expressed in Mega bit per second (Mbps) so configuring 1000 means 1,000,000,000 or 1Gbps.

Note that the router alert us to do the change across all routers.

After configuring autocost on all routers, R4 see links C+B as total cost of 2 and Links A+D as total cost of 11 and by that prefer only one path to R1 networks.

1 comment: