How does windows treat interface metric (which you can set at interface ip settings) and route settings? Which one does it prefer? What if I have interface with metric 1 but for this address there is other interface route with higher metric?

From Microsoft's route article on Technet:

The route with the lowest metric is chosen.

Q: What if I have interface with metric 1 but for this address there is other interface route with higher metric?

If you have similar routes with different metrics, the lowest metric route for the destination is chosen.

In case of overlapping routes, keep in mind that route matches with longer netmasks are always better than route matches matches with shorter netmasks (so route match length is more important than lower metric). If you ever have a question about which route windows chose for a destination, use route print <destination> from the cmd prompt

Trivial example:

[Mike_Pennington@Win7 ~]$ route print 127.0.0.1
===========================================================================
Interface List
 15...5c 26 0a 39 ac 9d ......Intel(R) 82577LM Gigabit Network Connection
 12...58 94 6b e4 c8 28 ......Intel(R) Centrino(R) Advanced-N 6200 AGN
  1...........................Software Loopback Interface 1
 24...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 11...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306 <---
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
  None
Persistent Routes:
  None
[Mike_Pennington@Win7 ~]$
  • this used to work, but something became borked after WinXP. Not sure if it the routing masks are miscalculated or network classification (public, work,home), DHCP, or what, but the metric is altogether ignored. – rjt Apr 9 at 22:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.