howtonetwork.net

Cisco Certification Training

  • Products
  • CCNA
    • CCNA Videos
    • CCNA Lectures
    • CCNA Practice Exams
    • Challenge Labs
      • Challenge Video Solutions
    • Cisco Commands
  • CCNP ROUTE
    • ROUTE Exams
  • CCNP SWITCH
    • SWITCH Exams
  • CCNP TSHOOT
  • Home
  • Join
  • Downloads
  • About Us
  • Whitepapers
  • Feature Articles
  • Helpdesk
  • FAQ
  • Free Training
You are here: Home / ip ospf cost

ip ospf cost

Command

IP OSPF Cost

Use

This command is used to manually set the OSPF link cost. This is typically done for traffic engineering purposes to modify what link OSPF will prefer. Lower is better.

Syntax

Router(config-if)#ip ospf cost <cost>

Example

In this example, we will use cost to make R1 prefer the frame-relay link to get to R3.

simple

Currently OSPF prefers the fa0/0 link with a cost of 3

R1(config-if)#do show ip route ospf | in 33.
33.0.0.0/32 is subnetted, 1 subnets
O 33.33.33.33 [110/3] via 10.1.1.2, 00:00:09, FastEthernet0/0
133.133.0.0/32 is subnetted, 1 subnets
O 133.133.133.133 [110/3] via 10.1.1.2, 00:00:09, FastEthernet0/0

Using the ip ospf cost command we set the Fa0/0 cost so that it is higher then any other link. R1 now prefers the S1/1 link with a cost of 65.

R1(config-if)#int fa0/0
R1(config-if)#ip ospf cost 200

R1(config-if)#do show ip route ospf | in 33.
33.0.0.0/32 is subnetted, 1 subnets
O 33.33.33.33 [110/65] via 192.168.13.2, 00:00:05, Serial1/1
133.133.0.0/32 is subnetted, 1 subnets
O 133.133.133.133 [110/65] via 192.168.13.2, 00:00:05, Serial1/1

Again, we change the cost of the S1/1 link so that it is higher then the frame-relay link S1/0. Now R1 is prefering the s1/0 link to reach R3. If S1/0 goes down it will prefer the s1/1 link with a cost of 150.
If that goes down it will use the fa0/0 link with a cost of 200.

R1(config-if)#int s1/1
R1(config-if)#ip ospf cost 150

R1(config-if)#do show ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/130] via 10.4.4.4, 00:00:01, Serial1/0
33.0.0.0/32 is subnetted, 1 subnets
O 33.33.33.33 [110/129] via 10.4.4.4, 00:00:01, Serial1/0

3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/129] via 10.4.4.4, 00:00:01, Serial1/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.5.5.5 [110/65] via 10.4.4.4, 00:00:01, Serial1/0
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O 10.4.4.3/32 [110/128] via 10.4.4.4, 00:00:01, Serial1/0
O 10.2.2.0/24 [110/129] via 10.4.4.4, 00:00:01, Serial1/0
O 10.4.4.4/32 [110/64] via 10.4.4.4, 00:00:01, Serial1/0
133.133.0.0/32 is subnetted, 1 subnets
O 133.133.133.133 [110/129] via 10.4.4.4, 00:00:01, Serial1/0

Get access to over 5 hours of IT webinar videos as well as regular study tips and ideas when you
join our mailing list

About This Site

We replaced this site some time ago with an upgraded version. Please feel free to enjoy the content and if you like what you see check out our brilliant new site:

howtonetwork.com

Keep In Touch

About Us

This is a free access website which has now been replaced by howtonetwork.com.

Navigation

  • Home
  • Join
  • Downloads
  • About Us
  • Whitepapers
  • Feature Articles
  • Helpdesk
  • FAQ
  • Free Training

Copyright

All content is protected by international copyright laws. Copyright Reality Press Ltd.

Copyright © 2023 · Dynamik Website Builder on Genesis Framework · WordPress · Log in