Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ping IP with source IP?

I am trying to send ping, but using with a source Ip. Tried this,

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 ?

like image 983
user198989 Avatar asked Nov 21 '14 16:11

user198989


2 Answers

You only need/want the -S flag if you have multiple network interface cards (NICs), and you want the source of the pings to come from a specific NIC; this is seldom needed. Your command

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.

So if you are trying to ping 88.65.48.77, just

ping 88.65.48.77
like image 175
Mark Stewart Avatar answered Oct 04 '22 15:10

Mark Stewart


Check your network using Source Address in different environment.

If you are a Windows user use the following command. Example:

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:

ping -I source address(x.x.x.x) target address(x.x.x.x) 

In Cisco device use the following command Example:

ping target address(x.x.x.x) source source address(x.x.x.x)
like image 28
B.M Peter Avatar answered Oct 04 '22 15:10

B.M Peter