我可以尝试通过特定适配器 ping 网站吗? [英] Can I try to ping a website through a specific adapter?

查看:73
本文介绍了我可以尝试通过特定适配器 ping 网站吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这不是一个太基本的问题.标题有点问这一切.:-)

I hope this isn't too basic a question. The title kind of asks it all. :-)

推荐答案

ping 命令将允许严格的源路由,因此您可以指定在出路时使用的默认网关.(这假设您的接口具有不同的网关,即位于不同的网络上)

The ping command will allow strict source routing so you can specify the default gateway to use on the way out. (This assumes your interfaces have distinct gateways i.e. are on different networks)

ping -k 192.169.1.1 microsoft.com
        ^ default gateway for desired interface

使用 WMI Win32_PingStatus 你可以在指定SourceRouteSourceRouteType的地方做同样的事情(这与使用ping -k基本相同)

Using WMI Win32_PingStatus you can do the same thing where you specify SourceRoute and SourceRouteType (This is essentially the same as using ping -k)

或者:

如果您的网络接口在同一个网络上,例如 LAN 卡和无线适配器您可以向您的机器添加自定义ROUTE,它可以通过特定接口发送所有流量.

If your network interfaces are on the same network, like a LAN card and a wireless adapater you can add a custom ROUTE to your machine, which can send all traffic through a specific interface.

来自路线帮助:

route ADD 207.46.0.0 MASK 255.255.0.0  192.168.1.1 METRIC 3 IF 2
        destination^      ^mask        ^gateway     metric^    ^
                                                      Interface^

这篇关于我可以尝试通过特定适配器 ping 网站吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆