从Windows上的特定networking适配器Ping

嗨,我一直在使用有线和无线网卡的2个网卡和笔记本电脑的服务器上解决networking问题。 我怎样才能强制PING和TELNET从一个特定的适配器发送? 我知道这是一个Windows的麻烦。 closures其中一个适配器不是一个选项,我总是通过其中一个适配器连接。 必须有一些命令行选项才能使一个适配器优先于另一个。

谢谢

你可以设置一个静态路由:

route add (destination subnet) MASK (destination subnet mask) (gateway) IF (interface) 

有关更多信息,请查看Microsoft的route文档

可能更容易的是使用-S开关,它允许您指定源IP地址(请参阅ping /?了解更多信息)。

你可以做的另一件事是更改绑定顺序,这符合你的select偏好一个适配器。 虽然它从Windows操作系统到操作系统有所不同,但它与此示例的位置相似:对于Windows 7,右键单击networking,然后单击属性。 然后点击“更改适配器设置”,然后点击菜单“高级”>“高级设置”,然后将想要优先的连接移到顶端。

从Windows 7(版本6.1 Build 7601:Service Pack 1)ping /?

 Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name Options: -t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -l size Send buffer size. -f Set Don't Fragment flag in packet (IPv4-only). -i TTL Time To Live. -v TOS Type Of Service (IPv4-only. This setting has been deprecated and has no effect on the type of service field in the IP Header). -r count Record route for count hops (IPv4-only). -s count Timestamp for count hops (IPv4-only). -j host-list Loose source route along host-list (IPv4-only). -k host-list Strict source route along host-list (IPv4-only). -w timeout Timeout in milliseconds to wait for each reply. -R Use routing header to test reverse route also (IPv6-only). -S srcaddr Source address to use. -4 Force using IPv4. -6 Force using IPv6. 

Microsoft TechNet Ping说明只能用于IPV6的文档(不正确)适用于:Windows Server 2003,Windows Vista,Windows XP,Windows Server 2008,Windows 7,Windows Server 2003 R2,Windows Server 2008 R2,Windows Server 2000 ,Windows Server 2012,Windows 8

Microsoft TechNet – 使用Ping命令(Windows 7和Server 2008 R2)(也缺less-S srcaddr)

所选适配器基于路由表。 您可以通过运行'route print'或'netstat -r'来检查路由表。 每个条目都会有一个指示路线权重的度量标准 – 较低的数字是首选。 您可以使用'route'命令来操作路由表。 路线/? 了解详情。