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:
- The interface with Metric 45 is a Wireless adapter
- The interface with Metric 15 is connected to a Hyper-V Virtual Switch hosted on the same machine.