Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

KB299540 explains how Windows XP automatically assign metrics to IP routes:

The following table outlines the criteria that is used to assign metrics for routes that are bound to network interfaces of various speeds.

Greater than 200 Mb: 10
Greater than 20 Mb, and less than or equal to 200 Mb: 20
Greater than 4 Mb, and less than or equal to 20 Mb: 30
Greater than 500 kilobits (Kb), and less than or equal to 4 Mb: 40
Less than or equal to 500 Kb: 50

However, they seem to have changed their algorithm in Windows 7, as my routing table looks like this:

IPv4 Route Table
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
    286         On-link    286         On-link    286         On-link    286         On-link    306         On-link    306         On-link    306         On-link    266         On-link    266         On-link    266         On-link    306         On-link    266         On-link    286         On-link     40

The only "correct" metric is the first one (Gigabit connection = 10). However, other routes using the Gigabit connection have metric = 266, my VPN has metric = 286, and loopback is 306 (?!).

Any idea what's going on?

share|improve this question
Any luck figuring this out? In XP when my VPN connects, all the routes to the remote network have a metric of 1 and local connections are 10. In Windows 7 even if you use the 'METRIC' parameter in the 'route add' command it still shows up with some arbitrary metric. Further, in XP all the interfaces are set to automatic metric. In Windows 7 even by specifying metrics on every interface they still come up arbitrarily! What gives? – John Clayton Nov 6 '09 at 16:20

I don't think it's new to Windows 7, I think it's there in Vista too.

However, I don't believe there's been a published set of rules that the algorithm follows, just that it's now on a scale of 1-9999.

share|improve this answer

Yes. Here is the solution.

goto your dialup setting properites (for 3G modem) -> networking -> select TCP/IP settings (IPv4) -> click properties-> in general tab, goto advanced tcp/ip settings -> here do following:

UNCHECK use default gateway on remote network CHECK disable class based route addition (for WIN VISTA/7 only)

now, when you connect dialup next time, your routing table metrics for lan connection will not be udpated !!

share|improve this answer
Who upvoted this?!? – Zero3 Sep 5 '15 at 13:23

I don't know the algorithm as well, but you can force a specific metric by changing it on the TCP/IP properties of your network card. On the General tab, click Advanced, uncheck Automatic Metric and set whatever value you like.

I tried this with somewhat a moderated sucess:

  • - On a restart this setting gets overwritten;
  • - When I connect my 3G modem it sets every other network adapter to a Metric value of +3k (while it retains a 30 value on its metric... :( )
  • - If I try to add a route rule the metric I defined is added to the interface's base metric, instead of being an absolute value. ([ref][1])

Does anyone know hoe to cincurvent any of these problems?

share|improve this answer

Myabe the metric has a meaning when the OS is comparing routes from the same protocol? And in that case there should be another metric which is not shown in this table in order to compare the importance of protocols (I mean direct connected, vpn, or other protocols etc)

In general in routing this metric has importance when comparing same protocols. FOr example if OSPF is used metric is taken into account for comparing routes coming from OSPF, but when comparing OSPF route and a directly configured interface, metric has no importance because by default the directly connected will be always preferred.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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