cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4254
Views
10
Helpful
10
Replies

OSPF: what command should be used to obtain cost by route?

When I enter the command

show ip route

 

I dont get the cost by route. What command should be used to obtain route cost?

 

Thanks,

Martin

2 Accepted Solutions

Accepted Solutions

It will be 2.
AD is 110.

I've found a link on Cisco learning forum where it's explained and at the same time there are all AD for all routing protocols.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

View solution in original post

hi,

you can use the show ip route or show ip route ospf <PROCESS ID> to be specific. look on the second number on the bracket. this is the OSPF metric (or cost) which is the calculated using the formula:

metric = 100,000,000 / interface bandwidth

this can be adjusted using the router ospf command: auto-cost reference-bandwidth

in the example below, 11 is the metric or OSPF cost for the network 172.16.3.0.

 O    172.16.3.0 [110/11] via 1.1.1.13, 00:10:04, FastEthernet0/0

 

View solution in original post

10 Replies 10

Francesco Molino
VIP Alumni
VIP Alumni
Hi

Costs are configured on interfaces if specifics.
Try this command:
sh ip ospf int | i Cost|Internet

You can remove everything behind the pipe if you want to see all details of that command.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Thanks for the answer. But I was wondering if there is a way to obtain a ROUTE COST based on the routing table. Not on an interface.

 

Regards,

Martin

Ok then you get it when issuing the command show ip route.

You will have the AD/Metric
Metric is the cost.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Ok thanks. Sorry for my ignorance im newbe with this router. Where is the metric in those routes?

 

O 130.0.0.0/16 [110/2] via 192.168.6.1, 02:24:17, FastEthernet0/0

O 131.0.0.0/16 [110/2] via 192.168.4.2, 02:21:50, FastEthernet0/1

172.30.0.0/24 is subnetted, 2 subnets

O 172.30.1.0 [110/2] via 192.168.6.1, 02:15:10, FastEthernet0/0

O 172.30.4.0 [110/2] via 192.168.4.2, 02:13:43, FastEthernet0/1

It will be 2.
AD is 110.

I've found a link on Cisco learning forum where it's explained and at the same time there are all AD for all routing protocols.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Thank you so much. Can you send the link? I will read it.

 

Regards,

Mart

Sorry i forgot to paste it:
https://learningnetwork.cisco.com/thread/56489

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

hi,

you can use the show ip route or show ip route ospf <PROCESS ID> to be specific. look on the second number on the bracket. this is the OSPF metric (or cost) which is the calculated using the formula:

metric = 100,000,000 / interface bandwidth

this can be adjusted using the router ospf command: auto-cost reference-bandwidth

in the example below, 11 is the metric or OSPF cost for the network 172.16.3.0.

 O    172.16.3.0 [110/11] via 1.1.1.13, 00:10:04, FastEthernet0/0

 

Thanks a lot!

 

Regards,

Martin

Just to add a few notes to John's posting.

The auto-cost itself is non-standard. Some other vendors don't support anything like it, some other vendors support something like it, but often use a different default value.

Cost can also be configured on an OSPF interface.

Aggregate cost is from router you're on to destination. Reverse path, even on exactly the same links, might have a different cost, because cost on each interface is per egress.

Lastly, on platforms supporting an auto-cost, bandwidth "faster" will be considered the same. So, for example, by default, a FE, gig, 10g, etc., egress would all have the same cost. Conversely with low bandwidths, OSPF aggregate cost can "overflow" and again multiple paths, with different costs, cannot be correctly told apart.

Review Cisco Networking for a $25 gift card