1

After reading this question, I was wondering how the operating system 'chooses' the Metric value for a route.

I have 2 dynamically added routes for internet:

      0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.239     45
      0.0.0.0          0.0.0.0         10.0.0.1       10.0.0.254     15

So naturally, my traffic is being routed to the gateway at 10.0.0.1 first because 15 < 45, if there are no routes on 10.0.0.1, it will be routed to 192.168.0.1 for delivery.

What I'm wondering is:

How does Windows (or any OS with a routing implementation) decide the metric value for these 2 interfaces?

I notice some people contradicting each other in the comments of the linked question when it comes to priority based on Ethernet/Wireless and the like. For this reason I want to note:

  1. The interface with Metric 45 is a Wireless adapter
  2. The interface with Metric 15 is connected to a Hyper-V Virtual Switch hosted on the same machine.
Nomad
  • 186

1 Answers1

1

I just found a microsoft support page explaining something called the Automatic Metric Feature.

A metric is a value that is assigned to an IP route for a particular network interface that identifies the cost that is associated with using that route. For example, the metric can be valued in terms of link speed, hop count, or time delay. Automatic Metric is a new feature in Windows that automatically configures the metric for the local routes that are based on link speed. The Automatic Metric feature is enabled by default, and it can also be manually configured to assign a specific metric.

For more info and tables with values, see the msdn support page here.

Nomad
  • 186