windows 用源IP Ping IP?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27065451/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ping IP with source IP?
提问by user198989
I am trying to send ping, but using with a source Ip. Tried this,
我正在尝试发送 ping,但使用源 Ip。试过这个,
ping example.org -i 88.65.48.77
It pings without any errors, but I am confused. In the manual, it says -S is a source operator. But if I use -S 88.65.48.77, I get a Ping Transmit failed. General Error.
So what is the correct way to do that ?
它 ping 没有任何错误,但我很困惑。在手册中,它说 -S 是一个源操作符。但是如果我使用 -S 88.65.48.77,我会得到一个Ping Transmit failed. General Error.
那么正确的方法是什么?
回答by Mark Stewart
You only need/want the -S
flag if you have multiple network interface cards (NICs), and you want the sourceof the pings to come from a specific NIC; this is seldom needed. Your command
-S
如果您有多个网络接口卡 (NIC),并且您希望ping的源来自特定的 NIC,则您只需要/想要该标志;这很少需要。你的命令
ping example.org -i 88.65.48.77
is actually saying to ping example.org with a TTL (time to live) value of 88.65.48.77, where -i is really expecting a maximum number of "hops" -- say 10, not an IP address.
实际上是说 ping example.org 的 TTL(生存时间)值为 88.65.48.77,其中 -i 确实期望最大数量的“跃点”——比如说 10,而不是 IP 地址。
So if you are trying to ping 88.65.48.77, just
因此,如果您尝试 ping 88.65.48.77,只需
ping 88.65.48.77
回答by B.M Peter
Check your network using Source Address in different environment.
在不同环境中使用源地址检查您的网络。
If you are a Windows user use the following command. Example:
如果您是 Windows 用户,请使用以下命令。例子:
ping target address(x.x.x.x) -S source address(x.x.x.x)
If you are a Linux user use the following command. Example:
如果您是 Linux 用户,请使用以下命令。例子:
ping -I source address(x.x.x.x) target address(x.x.x.x)
In Cisco device use the following command Example:
在 Cisco 设备中使用以下命令示例:
ping target address(x.x.x.x) source source address(x.x.x.x)