如何在Windows上设置手动添加路由的度量标准?

前端之家收集整理的这篇文章主要介绍了如何在Windows上设置手动添加路由的度量标准?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用以下命令添加路由,但指标不按我想要的方式工作.我希望我添加的路线成本更低.
C:\Users\cboyle>route ADD 0.0.0.0 MASK 0.0.0.0  192.168.76.2 METRIC 3 IF 11
 OK!

C:\Users\cboyle>

这是我在上面命令之前的路由表.

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\cboyle>route print
===========================================================================
Interface List
 11...00 1a 4d 84 48 22 ......Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller
 15...08 00 27 00 40 a3 ......VirtualBox Host-Only Ethernet Adapter
  1...........................Software Loopback Interface 1
 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.76.1    192.168.76.40     20
        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.56.0    255.255.255.0         On-link      192.168.56.1    276
     192.168.56.1  255.255.255.255         On-link      192.168.56.1    276
   192.168.56.255  255.255.255.255         On-link      192.168.56.1    276
     192.168.76.0    255.255.255.0         On-link     192.168.76.40    276
    192.168.76.40  255.255.255.255         On-link     192.168.76.40    276
   192.168.76.255  255.255.255.255         On-link     192.168.76.40    276
        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.56.1    276
        224.0.0.0        240.0.0.0         On-link     192.168.76.40    276
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link      192.168.56.1    276
  255.255.255.255  255.255.255.255         On-link     192.168.76.40    276
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
 15    276 fe80::/64                On-link
 15    276 fe80::49e3:31a5:5cc7:97ea/128
                                    On-link
  1    306 ff00::/8                 On-link
 15    276 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

C:\Users\cboyle>

在这之后.

C:\Users\cboyle>route print
===========================================================================
Interface List
 11...00 1a 4d 84 48 22 ......Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller
 15...08 00 27 00 40 a3 ......VirtualBox Host-Only Ethernet Adapter
  1...........................Software Loopback Interface 1
 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.76.1    192.168.76.40     20
          0.0.0.0          0.0.0.0     192.168.76.2    192.168.76.40     23
        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.56.0    255.255.255.0         On-link      192.168.56.1    276
     192.168.56.1  255.255.255.255         On-link      192.168.56.1    276
   192.168.56.255  255.255.255.255         On-link      192.168.56.1    276
     192.168.76.0    255.255.255.0         On-link     192.168.76.40    276
    192.168.76.40  255.255.255.255         On-link     192.168.76.40    276
   192.168.76.255  255.255.255.255         On-link     192.168.76.40    276
        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.56.1    276
        224.0.0.0        240.0.0.0         On-link     192.168.76.40    276
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link      192.168.56.1    276
  255.255.255.255  255.255.255.255         On-link     192.168.76.40    276
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
 15    276 fe80::/64                On-link
 15    276 fe80::49e3:31a5:5cc7:97ea/128
                                    On-link
  1    306 ff00::/8                 On-link
 15    276 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

C:\Users\cboyle>

我希望我添加的路由优先于默认路由.

我的猜测是,这是因为NIC上设置了自动度量标准选项.自动度量标准基于链接速度,因此我猜测您的主机已连接到100Mbps交换机端口.将仅基于链接速度为DG分配度量.任何静态分配的路由都将根据您指定的指标的链接速度PLUS分配一个指标.如果要为静态路由表条目分配的度量值低于分配给DG的度量标准,请禁用NIC上的“自动度量标准”选项.

http://support.microsoft.com/kb/299540

原文链接:https://www.f2er.com/windows/370294.html

猜你在找的Windows相关文章