How to ping another computer on a different network

Administrators can use ping as a troubleshooting method to test network connectivity. Businesses sometimes use tools such as Remote Desktop to perform computer maintenance or respond to trouble tickets from employees, but if problems occur when attempting to connect to the computer, the workstation could have problems communicating on the network. You can use ping to check if a remote computer is reachable, as well as test round-trip latency, or how long it takes for the target PC to respond to the request.

  1. Click "Start," type "command" into the search field and then choose "Command Prompt" from under Programs.

  2. Type "ping [x]" (without quotation marks) into Command Prompt. Replace "[x]" with the IP address or host name of the target computer.

  3. Press "Enter" to ping the remote computer. The results should look similar to the following, although with a different address and values:

    Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Topology used:

PING FROM PC1

PC1#ping 3.3.3.10

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.10, timeout is 2 seconds:

...!!

Success rate is 40 percent (2/5), round-trip min/avg/max = 40/52/64 ms

PC1#

Firstly PC1 does a bit wise comparison between source add and destination address and see if it’s in same subnet or different. Here its different subnet, so it need to send to it default gateway. So it check the mac address of gateway in its ARP table. If it does, it sends the data to R1's MAC. If not, it sends out a broadcast ARP to learn the MAC address of Gateway.

Reply from R1 (default gateway for PC1)

Now it prepare a data frame with R1's MAC address as the destination and the contents will be an IP packet with PC1 IP address as source and PC2 IP address as destination.

Once the frame arrives at R1, R1 checks it out to make sure it's intact and then strips off the frame header/trailer.

R1 looks at the destination IP address and compares that to its routing table. R1 see that it has an entry for network 2 and that the next-hop router is R2. 

If R1 does not have mac for R2 it also tried to resolve (learn) mac address via ARP

Now since R1 has mac for R2 it send an ICMP packet to R2 for PC2.

R1 might not get response for 1st packet as R2 too need to resolve ARP for PC2 *(will see later)

R2 gets the packet for PC2 and sees that it is in same network, and from R2's perspective, it is directly connected, so it resolves ARP for PC2 and send the packet out the right interface to get to PC2

Now R2 will put a frame header/trailer on the packet with the appropriate MAC address, and send the frame out directly to PC2. Traffic returning from PC2 back to PC1 will follow the whole process, tracing the steps back to PC1. 

Hope this helps !!

Even if you can successfully ping another router on the internet - and this is often blocked - it only confirms the presence of this router, not of any computers behind it.

However many (but not all) routers will allow you to open ports from the outside to internal computers and this can provide a way to test that such computer is active - e.g. by installing and using nmap //nmap.org/book/inst-macosx.html (for Windows you can use portqry.exe).

To find out how to open ports on the external router (i.e. the one which the computers on your 'outside wireless network' are using to access the network), you need to have administrator access to it, know the make and model and check how to set it either from its manual or, for many routers, //portforward.com. Sorry I can't be more specific but it really depends on the router model...

A PC in a private IP range can't be acccesed from the public internet.

Devices in private range connecting to internet use a proxy or router/NAT device that replaces the local source IP for a single public IP address that redides in your router/NAT.

However, you can make an exception to that, opening a port in the router and allowing that traffic directed to your public IP adddress and that specific port (for example, 80) get through the router and finally to your PC.

Now your PC is public at least on port 80. Internet knows how to get to your PC using the public address and the router translate that public Ip to the private that your device uses.

An example:

Your PC has the private IP address 192.168.2.3 and is connected to an internet router that has the public IP 54.239.25.200.

Now, if you open the port 80 in the router then anyone in the public internet could connect to your PC using the URL //54.239.25.200:80

The public internet doesn't know your private IP, they know your public IP address.

Última postagem

Tag