設定網路介面的訂單Configure the Order of Network Interfaces

適用於:Windows Server(以每年次管道)、Windows Server 2016Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016

在 Windows Server 2016 和 Windows 10 中,您可以使用介面度量設定的網路介面順序。In Windows Server 2016 and Windows 10, you can use the interface metric to configure the order of network interfaces.

這是在舊版 Windows 和 Windows Server 允許您透過使用者介面或命令設定繫結訂單的網路介面卡的不同於INetCfgComponentBindings::MoveBeforeINetCfgComponentBindings::MoveAfterThis is different than in previous versions of Windows and Windows Server, which allowed you to configure the binding order of network adapters by using either the user interface or the commands INetCfgComponentBindings::MoveBefore and INetCfgComponentBindings::MoveAfter. 這兩種方法來排序網路介面不是在 Windows Server 2016 和 Windows 10 中提供。These two methods for ordering network interfaces are not available in Windows Server 2016 and Windows 10.

而是,您可以使用新的方法所設定的每個介面卡介面度量設定列舉的訂單的網路介面卡。Instead, you can use the new method for setting the enumerated order of network adapters by configuring the interface metric of each adapter. 您可以設定介面度量使用設定為 NetIPInterface Windows PowerShell 命令。You can configure the interface metric by using the Set-NetIPInterface Windows PowerShell command.

當網路流量路徑選擇與您已設定介面公制的參數設定-NetIPInterface命令整體用來判斷介面喜好設定的這個度量是路由度量和和介面度量。When network traffic routes are chosen and you have configured the InterfaceMetric parameter of the Set-NetIPInterface command, the overall metric that is used to determine the interface preference is the sum of the route metric and the interface metric. 一般而言,介面度量提供特定的介面,例如使用有線如果兩者有線並無線有可用的喜好設定。Typically, the interface metric gives preference to a particular interface, such as using wired if both wired and wireless are available.

Windows PowerShell 命令下例顯示使用此參數。The following Windows PowerShell command example shows use of this parameter.

Set-NetIPInterface -InterfaceIndex 12 -InterfaceMetric 15

介面卡清單中出現的順序是由 IPv4 或 IPv6 介面度量判斷。The order in which adapters appear in a list is determined by the IPv4 or IPv6 interface metric. 如需詳細資訊,請查看GetAdaptersAddresses 函式For more information, see GetAdaptersAddresses function.

本指南所有主題的連結,會看到的網路效能子系統調整For links to all topics in this guide, see Network Subsystem Performance Tuning.