What does term metric mean?

2

In the ifconfig man page I encountered:

metric N
              This parameter sets the interface metric.

Searched the net, but didn't find clear explanation, only something like "it sets priority of the NIC interface".

Is there definitive definition of it? When should one use it?

That question is not duplicate as SU indicates, because it asks about metric term in context of NIC interfaces not in context of routing tables, so one might consider it as a distinct question, as I do.

Bulat M.

Posted 2017-01-14T17:18:13.647

Reputation: 247

Question was closed 2017-01-16T17:59:09.513

Answers

3

It is very common in today computers (especially Laptops) to have Wired Network Card (NIC) as well as Wireless. Often users end up in a conflict and they do not know how to control the system.

Windows Network configures each card to have its own TCP/IP. The two cards can live together in peace and harmony provided they areconfigured to work with Set Priority.

The TCP/IP configuration has a special setting (under the Advance menu) for Metrics.

If you put a different number in the Metrics entry of the cards, the network connection would default to the connection with the lower number.

(Emphasis mine, source)

What this basically means is that if you have both a Wired and a Wireless card, and you set the metric of the first as 1 and the second as 2, Windows would default to the one with the lower metric (ie, the Wired Network).

TL;DR Windows defaults to the connection with the lower metric to avoid conflict

rahuldottech

Posted 2017-01-14T17:18:13.647

Reputation: 5 095

Could you elaborate in the context of UNIX systems? – Bulat M. – 2017-01-14T18:28:28.450

1@BulatM. Check the question linked by DavidPostill... Mom asking me to go to sleep, I'll add details tomorrow :D – rahuldottech – 2017-01-14T18:40:05.760

@rahuldottech, How to set the metric of the first and the second devices as you said in the answer? – Ac3_DeXt3R – 2018-09-06T09:04:02.310