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

网卡:

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>

 

上一篇:注册页面


下一篇:单选按钮input[type=radio],加上disabled后按钮颜色失效,始终默认为灰色