1

我有几个连接到不同网络的网络连接。我想确保某个网络连接位于列表的顶部。所以我想以编程方式对 Windows 的网络适配器的绑定顺序进行脚本更改(win 2008 服务器和 win 2003 服务器)

有没有办法以编程方式更改绑定顺序?只需使用 wmi、netsh、vbscript、编辑 regstry 或其他脚本或命令行工具。

我发现编辑注册表注册表 HKLM\system\currentcontrolset\services\TCPIP\linkage\ -> 绑定值,是 Windows 2008 服务器上的一种方式。使用“netstat -rn”可以发现绑定顺序发生了变化。但是在网络高级 UI(ncpa.cpl) 上,顺序没有改变。并且看起来它在 Windows 2003 服务器上不起作用。

有人知道如何使用命令行更改网络适配器的绑定顺序吗?

谢谢

4

1 回答 1

1

这看起来就是你所追求的: http ://realworldwindows.blogspot.com/2006/11/sharing-network-provider-order-in.html

或者,您可以轻松编写一个批处理文件来禁用主适配器,以便您希望成为主适配器的适配器接管。然后重新启用原来的。

例子:

@echo off
netsh interface set interface "Local Area Connection" DISABLED
:: do something here on the secondary connection
netsh interface set interface "Local Area Connection" ENABLED
于 2014-02-21T13:44:01.747 回答