指标 (ipv4settings---tcpip-interface) Metric (microsoft-windows-tcpip-interfaces-interface-ipv4settings-metric)

Metric 指定 IPv4 协议的接口跃点数。Metric specifies the interface metric for the IPv4 protocol. 选择路由时,用于确定首选项的总体指标是路由指标和接口指标的总和。When routes are chosen, the overall metric used to determine the preference is the sum of the route metric and the interface metric.

通常,接口跃点向特定接口提供首选项,假设有两个适配器和接口可用于连接到同一目标。Typically, the interface metric gives preference to a particular interface, assuming two adapters and interfaces are available with connectivity to the same destination. 如果未指定首选项,堆栈将应用每个接口的堆栈生成的自动度量值。If a preference is not specified, the stack will apply the automatic metric, generated by the stack for each interface.

这种情况通常适用于服务器使用多个以太网 Nic 且不会应用于客户端方案的服务器方案中,这是由于新的 WCM 功能导致的。This scenario will typically apply in a server scenario where the server has multiple Ethernet NICs and will not apply in a client scenario due to the new WCM feature.

如果未指定首选项,堆栈会选择自动指标,例如自动通过无线连接。If a preference is not specified, the stack will choose an automatic metric, such as automatically preferring wired over wireless.

Values

metric

指定 IPv4 协议的接口跃点数。Specifies the interface metric for the IPv4 protocol. 范围为每秒5个 (2 gb (GB) ,每秒) 到 50 (小于 500 kb (KB) /秒) 。The range is from five (more than 2 gigabytes (GB) per second) to fifty (less than 500 kilobytes (KB) per second).

有效的配置阶段Valid Configuration Passes

specializespecialize

windowsPEwindowsPE

父层次结构Parent Hierarchy

Microsoft-Windows-TCPIP | 接口 | 接口 | Ipv4Settings | 指标Microsoft-Windows-TCPIP | Interfaces | Interface | Ipv4Settings | Metric

适用于Applies To

有关此组件支持的 Windows 版本和体系结构的列表,请参阅 Microsoft-WINDOWS TCPIPFor a list of the Windows editions and architectures that this component supports, see Microsoft-Windows-TCPIP.

XML 示例XML Example

以下 XML 输出显示了如何配置 TCPIP。The following XML output shows how to configure TCPIP.

<component name="Microsoft-Windows-TCPIP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <Interfaces>
   <!-- Add static IP address (192.168.0.1/24, ffff:1::3/48) & route (12.34.0.0/16) to interface with identifier "Ethernet 1" -->      <Interface wcm:action="add">
         <Ipv4Settings>
            <DhcpEnabled>true</DhcpEnabled> 
            <Metric>20</Metric> 
            <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled> 
         </Ipv4Settings>
         <Ipv6Settings>
            <DhcpEnabled>false</DhcpEnabled> 
            <Metric>30</Metric> 
            <RouterDiscoveryEnabled>true</RouterDiscoveryEnabled> 
         </Ipv6Settings>
      <Identifier>Ethernet 1</Identifier>
         <UnicastIpAddresses>
           <IpAddress wcm:action="add" wcm:keyValue="1">192.168.0.1/24</IpAddress>
           <IpAddress wcm:action="add" wcm:keyValue="2">ffff:1::3/48</IpAddress>
         </UnicastIpAddresses>
         <Routes>
            <Route wcm:action="add">
               <Identifier>1</Identifier> 
               <Metric>10</Metric> 
               <NextHopAddress>12.34.0.0</NextHopAddress> 
               <Prefix>16</Prefix> 
            </Route>
            <Route wcm:action="add">
               <Identifier>10</Identifier> 
               <Metric>29</Metric> 
               <NextHopAddress>12.34.56.0</NextHopAddress> 
               <Prefix>24</Prefix> 
            </Route>
         </Routes>
      </Interface>
      <Interface wcm:action="add">
         <Ipv4Settings>
            <DhcpEnabled>true</DhcpEnabled> 
            <Metric>20</Metric> 
            <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled> 
         </Ipv4Settings>
         <Ipv6Settings>
            <DhcpEnabled>false</DhcpEnabled> 
            <Metric>10</Metric> 
            <RouterDiscoveryEnabled>true</RouterDiscoveryEnabled> 
         </Ipv6Settings>
         <Identifier>Local Area Connection</Identifier> 
         <UnicastIpAddresses>
            <IpAddress wcm:action="add" wcm:keyValue="1">123.45.67.8</IpAddress> 
            </UnicastIpAddresses>
         <Routes>
            <Route wcm:action="add">
               <Identifier>1</Identifier> 
               <Metric>10</Metric> 
               <NextHopAddress>12.34.0.0</NextHopAddress> 
               <Prefix>16</Prefix> 
            </Route>
         </Routes>
      </Interface>
   </Interfaces>
</component>

Ipv4SettingsIpv4Settings