Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
          0.0.0.0          0.0.0.0      192.168.0.1      192.168.0.3     10
          0.0.0.0          0.0.0.0   10.202.254.254       10.202.1.2    286
       10.202.0.0      255.255.0.0         On-link        10.202.1.2    286
       10.202.1.2  255.255.255.255         On-link        10.202.1.2    286
   10.202.255.255  255.255.255.255         On-link        10.202.1.2    286
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      192.168.0.0    255.255.255.0         On-link       192.168.0.3    266
      192.168.0.3  255.255.255.255         On-link       192.168.0.3    266
    192.168.0.255  255.255.255.255         On-link       192.168.0.3    266
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link       192.168.0.3    266
        224.0.0.0        240.0.0.0         On-link        10.202.1.2    286
  255.255.255.255  255.255.255.255         On-link        10.202.1.2     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

3 Answers 3

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

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

Your Answer

 
discard

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.