[Windows]多网卡配置网卡优先级

匿名 (未验证) 提交于 2019-12-02 23:48:02

网卡:

PS C:\Users\Administrator> Get-NetIPInterface  ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore ------- --------------                  ------------- ------------ --------------- ----     --------------- ----------- 21      Ethernet4                       IPv6                  1500              10 Enabled  Connected       ActiveStore 19      Ethernet3                       IPv6                  1500              10 Enabled  Connected       ActiveStore 17      Ethernet2                       IPv6                  1500              10 Enabled  Connected       ActiveStore 15      Ethernet1                       IPv6                  1500              10 Enabled  Connected       ActiveStore 12      Ethernet0                       IPv6                  1500              10 Enabled  Connected       ActiveStore 22      isatap.{3E6AE9CB-2BD6-41C1-8... IPv6                  1280              50 Disabled Disconnected    ActiveStore 20      isatap.{FCD86E5A-DAE7-495F-B... IPv6                  1280              50 Disabled Disconnected    ActiveStore 18      isatap.{A4AE541B-7AF6-44D8-B... IPv6                  1280              50 Disabled Disconnected    ActiveStore 16      isatap.{AC30180C-0F53-40E1-8... IPv6                  1280              50 Disabled Disconnected    ActiveStore 14      6TO4 Adapter                    IPv6                  1280              10 Enabled  Connected       ActiveStore 13      isatap.{3F8628DF-A8A6-4F26-9... IPv6                  1280              50 Disabled Disconnected    ActiveStore 1       Loopback Pseudo-Interface 1     IPv6            4294967295              50 Disabled Connected       ActiveStore 21      Ethernet4                       IPv4                  1500              10 Disabled Connected       ActiveStore 19      Ethernet3                       IPv4                  1500              10 Disabled Connected       ActiveStore 17      Ethernet2                       IPv4                  1500              10 Disabled Connected       ActiveStore 15      Ethernet1                       IPv4                  1500              10 Disabled Connected       ActiveStore 12      Ethernet0                       IPv4                  1500              10 Disabled Connected       ActiveStore 1       Loopback Pseudo-Interface 1     IPv4            4294967295              50 Disabled Connected       ActiveStore   PS C:\Users\Administrator>

可见 ETH0-4都是10的优先级。

配置网卡优先级:

PS C:\Users\Administrator> Set-NetIPInterface -InterfaceIndex 15 -InterfaceMetric 11 PS C:\Users\Administrator> Set-NetIPInterface -InterfaceIndex 17 -InterfaceMetric 12 PS C:\Users\Administrator> Set-NetIPInterface -InterfaceIndex 19 -InterfaceMetric 13 PS C:\Users\Administrator> Set-NetIPInterface -InterfaceIndex 21 -InterfaceMetric 14

查看:

PS C:\Users\Administrator> Get-NetIPInterface  ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore ------- --------------                  ------------- ------------ --------------- ----     --------------- ----------- 21      Ethernet4                       IPv6                  1500              14 Enabled  Connected       ActiveStore 19      Ethernet3                       IPv6                  1500              13 Enabled  Connected       ActiveStore 17      Ethernet2                       IPv6                  1500              12 Enabled  Connected       ActiveStore 15      Ethernet1                       IPv6                  1500              11 Enabled  Connected       ActiveStore 12      Ethernet0                       IPv6                  1500              10 Enabled  Connected       ActiveStore 22      isatap.{3E6AE9CB-2BD6-41C1-8... IPv6                  1280              50 Disabled Disconnected    ActiveStore 20      isatap.{FCD86E5A-DAE7-495F-B... IPv6                  1280              50 Disabled Disconnected    ActiveStore 18      isatap.{A4AE541B-7AF6-44D8-B... IPv6                  1280              50 Disabled Disconnected    ActiveStore 16      isatap.{AC30180C-0F53-40E1-8... IPv6                  1280              50 Disabled Disconnected    ActiveStore 14      6TO4 Adapter                    IPv6                  1280              10 Enabled  Connected       ActiveStore 13      isatap.{3F8628DF-A8A6-4F26-9... IPv6                  1280              50 Disabled Disconnected    ActiveStore 1       Loopback Pseudo-Interface 1     IPv6            4294967295              50 Disabled Connected       ActiveStore 21      Ethernet4                       IPv4                  1500              14 Disabled Connected       ActiveStore 19      Ethernet3                       IPv4                  1500              13 Disabled Connected       ActiveStore 17      Ethernet2                       IPv4                  1500              12 Disabled Connected       ActiveStore 15      Ethernet1                       IPv4                  1500              11 Disabled Connected       ActiveStore 12      Ethernet0                       IPv4                  1500              10 Disabled Connected       ActiveStore 1       Loopback Pseudo-Interface 1     IPv4            4294967295              50 Disabled Connected       ActiveStore   PS C:\Users\Administrator>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!