Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Significance of metric in route add command

Indrajit Bhagat
Regular Advisor

Significance of metric in route add command

Hi All

 

I had basic query in route add command:

 

route add -p 192.168.100.0 mask 255.255.255.0 192.168.6.12 metric 1

What is an significance of metric in route add command, sometime it is 0 and sometimes it is 1, sometimes we are not mentioninig,

 

Any suggestion would be highly appreciable,

 

Regards

Indrajit Bhagat

3 REPLIES
Patrick Wallek
Honored Contributor

Re: Significance of metric in route add command

From the route man page.  I think 'metric' is the same as the count in the command:

 

count         

An integer that indicates whether the gateway is a remote host or the local host.  If the route leads to a destination through a remote gateway, count should be a number greater than 0.  If the route leads to destination and the gateway is the local host, count should be 0.  The default for count is zero.  The result is not defined if count is negative.

Indrajit Bhagat
Regular Advisor

Re: Significance of metric in route add command

Hi Thanks for your suggestion. Any other suggestion would be appreciable

 

Regards

Indrajit Bhagat

Patrick Wallek
Honored Contributor

Re: Significance of metric in route add command

From the Linux 'info route' command:

 

Metric

The 'distance' to the target (usually counted in hops). It is not used by recent kernels, but may be needed by routing daemons.

 

Links from Google:

 

Search string -- what is the metric option in route command

 

http://linux.about.com/od/commands/l/blcmdl8_route.htm

http://tldp.org/LDP/nag/node32.html

http://www.inetdaemon.com/tutorials/internet/ip/routing/metrics.shtml

 

There are numerous others, but you should be able to find a lot more via Google.