cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
112874
Views
37
Helpful
13
Replies

Default Metric value for static routes in CISCO ?

Rajesh cisco
Level 1
Level 1

Hi Floks,

i have basic doubt on metric calculation of the routes in cisco routers.

  1. what was the default metric value for static routes ?
  2. How it is calculated ?

Please share me if there is any link for reference.

thanks and regards,

Rajesh Kumar V

1 Accepted Solution

Accepted Solutions

I believe that the prior response has confused metric with Administrative Distance. A static route does have an Administrative Distance and by default it is 1 and can be set to some different value. Metrics are used by dynamic routing protocols. A static route does not have a metric unless it is being redistributed into a dynamic routing protocol and in that case the assignment of metric is dependent on the particular routing protocol (OSPF does it differently from EIGRP which does it differently from RIP).

 

HTH

 

Rick

HTH

Rick

View solution in original post

13 Replies 13

Rajesh cisco
Level 1
Level 1

 

 

Any comments really helpful for me . please share your points.

 

thanks

Rajeshkumar V

Hi Rajesh,

 

Default route you cannot set it to 0. It can have the metric between 1 to 255.

 

Please do rate for the helpful posts and mark correct answers

 

Thanks

Karthik

 

Thanks karthi.

So, Basically we cannot use 0 as metric for directly connected route.

In that case we cannot use 0 as the metric for static route  too ?.

I see that many router manufactures  use metric 0 (ad=1 metric=0 [1/0]) for static routes and also standard  mention that non valid metric is -1 and not 0.

 

thanks

Rajesh.

Directly connected can be considered as 0 always and static route is with 1 as the default and it differs for each routing protocols.

Route SourceDefault Distance Values
Connected interface0
Static route1
Enhanced Interior Gateway Routing Protocol (EIGRP) summary route5
External Border Gateway Protocol (BGP)20
Internal EIGRP90
IGRP100
OSPF110
Intermediate System-to-Intermediate System (IS-IS)115
Routing Information Protocol (RIP)120
Exterior Gateway Protocol (EGP)140
On Demand Routing (ODR)160
External EIGRP170
Internal BGP200
Unknown*255

 

 

 

thanks a lot karthi.

what you said is exactly correct for Administrative Distance (AD). 

my doubt is in metric point. can we set 0 as a metric for static route ? if yes , how we are determining.

thanks

Rajesh kuamr V

 

example:

R1#sh ip route 2.2.2.0
Routing entry for 2.2.2.0/24
  Known via "static", distance 1, metric 0 (connected)
  Routing Descriptor Blocks:
  * 12.12.12.2
      Route metric is 0, traffic share count is 1
    directly connected, via Serial0/1

I am not sure you can achieve it with static route.... when you redistribute static routes in to dynamic routing protocols you can set a metric for the static route.

But in static route as per my knowledge you cannot do it.

 

Regards

Karthik

 

thanks karthi.

i will check and update u.

vmiller
Level 7
Level 7

 

 

1. Default is one. it can be overridden

2.Its not calculated. Dynamic protocols calculate metrics. this is static...therefore no calculation. It can be "set" with a configuration command.

 

http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_pi/configuration/12-4/iri-12-4-book.html

I believe that the prior response has confused metric with Administrative Distance. A static route does have an Administrative Distance and by default it is 1 and can be set to some different value. Metrics are used by dynamic routing protocols. A static route does not have a metric unless it is being redistributed into a dynamic routing protocol and in that case the assignment of metric is dependent on the particular routing protocol (OSPF does it differently from EIGRP which does it differently from RIP).

 

HTH

 

Rick

HTH

Rick

Hi All,

Thanks for sharing.

i have another question.

 

what was the metric of local route by default. can i set that to 0 ?

please confirm.

Hello everyone,

What does [1/0] mean for static routes when we give the command show ip route.
I know 1 is the AD value of static route, and 0 is the metric value.
But what does 0 represent here? Is it hop count to next directly connected interface.. how is the 0 metric value calculated and why is it always 0 in [1/0].
If you can explain with a diagram, it would really help. Thanks. :-)

Hello @whizkidraj ,

as clearly explained in this thread in Cisco IOS implementation static routes have an admin distance of 1 by default that can be changed when configuring a so called floating static route.

The metric value is never computed in static routing.

The IP routing table daemon provides a 0 for this missing value for static entries because it handles also dynamic routing entries in the form [AD/metric].

In the case of static routes that [1/0] the 0 is just a place holder a value given to a field that is never checked. It cannot be modified by configuration.

To be noted when a static route specifies an outgoing interface instead of an IP next-hop it can have AD 0 like a connected route.

But in evey case the metric value is meaningless when comparing static routes between them or with entries generated by dynamic routing protocols.

The most specific entry is used first then if there is a tie the lowest AD is preferred.

This is correct because each routing protocol has its own way to calculate metric for example in RIP a metric of 16 is infinite . OSPF intra area routes are 16 bit unsigned integer ( up to 65,535) OSPF inter area are 24 bit values. EIGRP metric was 32 bit in classic EIGRP. In last EIGRP implementation (the named EIGRP ) the metric is 64 bit integer and needs a scaling factor to be reported in the routing table as the routing table metric field is 32 bit wide.

 

Hope to help

Giuseppe

Review Cisco Networking for a $25 gift card