What is the ping and traceroute command option to use in order to check the connectivity between 2 machines (machine A and machine B) using my machine (machine C) ? How do I specify the source machine IP? ping -S machineAIP machineBIP or ping -I machineAIP machineBIP don't seem to work from my debian 8 machine.

  • Hello and welcome to the U&L stack exchange site! Please review the Help Center to get information on how to best post to this site. To get to your question, neither of those options in ping do what you wish. Is it possible to connect to one of the servers and complete a ping from there? Depending on your network setup if your machine can ping both servers successfully, barring firewall rules on one or the other, they should also be able to communicate. – kemotep Nov 19 '18 at 14:34
  • Is this what you have in mind? – RubberStamp Nov 19 '18 at 16:07

While ping allows you to set intermediate hosts, I think you can only do this if the intermediate hosts are willing to accept traffic intended for the destination (i.e., they behave as gateways). See https://superuser.com/questions/311849/how-can-i-ping-via-an-alternate-gateway

In this situation, I'd just use SSH:

ssh machineA ping machineB
  • Thanks for your answer but then I can't use this since I'll have to keep track of the passwords of all the machines I'm going to connect. I thought of running socket io node in machine A and B and then requesting from machine C to source machine(either A or B depending on the machine from where I want to ping) to ping the other machine and give me the result back. – shwetha nayak Nov 23 '18 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.