Tuesday, August 5, 2008

Using the Ping command

The ping command lets you verify whether another network node is reachable. It can also be used to determine the quality of the link between the computers. Let's see how to work with this command.

Running the Ping command
On a computer which is connected to a network, do the following:

  1. Start > Run...,
  2. Type in cmd and click OK,
  3. On the command prompt, enter the command ping 192.168.0.2 and press Enter OR,
  4. Enter the command ping computerName and press Enter, where computerName is the name of the remote computer.
    NOTE: Here, it is important to understand that in the ping command you should use the IP or computer name of the remote computer.
Identifying typical output behaviors of the Ping command
If the output of the ping command is something like:

Pinging 192.168.0.2 with 32 bytes of data:

Reply from 192.168.0.2: bytes=32 time=18ms TTL=128
Reply from 192.168.0.2: bytes=32 time=18ms TTL=128
...


then it means that the remote computer with the given IP is alive as it is replying to our ping command.

If the output of the ping command looks something like:

Pinging 192.168.0.2 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.0.2: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),


then there is a problem connecting to the remote computer with the given IP. This could occur for several bunch of reasons:
  • one of the network cables could be unplugged,
  • the remote computer might not be powered up,
  • the remote computer may have a firewall that could be preventing communication,
  • one of the network cables could be faulty or damaged,
  • the remote computer may not have the IP configuration compatible with your computer,
  • etc.
For guidance in setting up your network, refer to the article Forming a small network at home (Part II).

There are several other options you can use with the ping command. To list more optionsfor the ping command, enter ping /? at the command prompt.

Forming a small network at home (PART II)

Setting parameters manually on all computers
In this article I will discuss how to form a small network at home with two computers and a network switch/hub. For this article we will configure the TCP/IP settings manually. The ingredients needed here are discussed in the PART I of this article.

A. Connecting the computers physically:
First of all power up both your computers and your network switch. Now plug in one end of your patch cord (straight network cable) in the computer's LAN card port and the second end of the patch cord in any port of your network switch. Do the same with the second computer. The two computers are now physically connected.
NOTE: please remember to use a straight network cable that has been tested properly with a cable tester.

B. Configuring the TCP/IP settings:
On your first computer, do the following:
  1. Go to Start > Settings > Network Connections,
  2. Right click 'Local Area Connection' and select Properties,
  3. In the Properties window, double click 'Internet Protocol (TCP/IP)',
  4. Here, select 'Use the following IP address' radio button,
  5. For IP address provide IP 192.168.0.1,
  6. For Subnet mask provide 255.255.255.0,
  7. Leave rest of the fields blank for now,
  8. Click OK until you exit both dialog windows.
Now repeat the above steps 1 through 8 for the second computer, with the exception of providing the IP 192.168.0.2 in step 5.

C. Configure Windows Firewall
If you haven't tampered with the Windows Firewall up till now, then chances are that it is enabled. Your Windows XP Firewall will block any connections keeping the ports closed unless you add an exception. Here, we want Windows to allow file sharing, so we will add this type of communication as an exception.

On all computers, do the following:
  1. Go to Start > Settings > Network Connections,
  2. Right click 'Local Area Connection' and select Properties,
  3. In the 'Advanced' tab click the settings button under Windows Firewall,
  4. In the 'General' tab, 'On (recommended)' is probably selected. If not, select it,
  5. In the same tab, uncheck 'Don't allow exceptions', as shown in the image above,
  6. In the 'Exceptions' tab, find 'File and Printer Sharing' under 'Programs and Services' heading and check it,
  7. Now click on the 'Edit...' button,
  8. Click on the 'Change Scope' button,
  9. In the 'Change Scope' dialog window select 'My network (subnet) only'. This will ensure that this type of communication is only allowed for your network,
  10. Click OK on all open dialog windows and exit.
Congratulations, you have just configured your first network.

D. Verify if both computers are connected
The previously discussed 'ping' command can be used to verify if there is a connection between both the computers. For help using the ping command, please refer to the article: Using the Ping command.


Related articles on this blog
  1. Forming a small network at home (PART I),
  2. Forming a small network at home (PART III),
  3. Forming a small network at home (PART IV),
  4. Changing Network Authentication Mode,
  5. Using the Ping command.