How do you ping a loopback address?

A loopback address is a distinct reserved IP address range that starts from 127.0.0.0 ends at 127.255.255.255 though 127.255.255.255 is the broadcast address for 127.0.0.0/8. The loopback addresses are built into the IP domain system, enabling devices to transmit and receive the data packets. The loopback address 127.0.0.1 is generally known as localhost.

TCP/IP protocol manages all the loopback addresses in the operating system. It mocks the TCP/IP server or TCP/IP client on the same system. These loopback addresses are always accessible so that the user can use them anytime for troubleshooting TCP/IP.

Whenever a protocol or program sends any data from a computer with any loopback IP address, that traffic is processed by a TCP/IP protocol stack within itself, i.e., without transmitting it to the network. That is, if a user is pinging a loopback address, they’ll get the reply from the same TCP/IP stack running on their computer.  So, all the data transmitted to any of the loopback addresses as the destination address will not pop up on the network.

127.0.0.1 is the most commonly used loopback address; generally, 127.0.0.1 and localhost are functionally similar, i.e., the loopback address 127.0.0.1 and the hostname localhost; are internally mapped. Though, other loopback addresses are also accessible and can be used. 

IPv4 and IPv6 Loopback Addresses:

  • The IPv4 loopback address is 127.0.0.0/8 and the most commonly used loopback address is 127.0.0.1.
  • The IPv6 loopback address is ::1

How to use the “ping” Command:

  • To use the “ping” command go to the windows start menu.
  • Search for “Command prompt”.
  • Type in “ping” followed by the loopback address. and,
  • Hit enter.

For example, as can be seen below, the outputs of four different IPv4 loopback addresses (127.0.0.0, 127.0.0.1, 127.15.90.69, and 127.255.255.255) the network and broadcast addresses are unreachable loopback addresses and IPv6 loopback address ::1.

ping output for 127.0.0.0 (Network address).

C:\Users\bklad>ping 127.0.0.0

Pinging 127.0.0.0 with 32 bytes of data:
General failure.
General failure.
General failure.
General failure.

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

ping output for 127.0.0.1

C:\Users\bklad>ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
   Minimum = 0ms, Maximum = 0ms, Average = 0ms  

ping output for 127.15.90.69

C:\Users\bklad>ping 127.15.90.69

Pinging 127.15.90.69 with 32 bytes of data:
Reply from 127.15.90.69: bytes=32 time<1ms TTL=128
Reply from 127.15.90.69: bytes=32 time<1ms TTL=128
Reply from 127.15.90.69: bytes=32 time<1ms TTL=128
Reply from 127.15.90.69: bytes=32 time<1ms TTL=128

Ping statistics for 127.15.90.69:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
   Minimum = 0ms, Maximum = 0ms, Average = 0ms

ping output for 127.255.255.255 (Broadcast address).

C:\Users\bklad>ping 127.255.255.255

Pinging 127.255.255.255 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

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

ping output for ::1.

C:\Users\bklad>ping ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
   Minimum = 0ms, Maximum = 0ms, Average = 0ms

Advantages of loopback address:

  • It is an efficient method to find a device on the network.
  • It can be configured as the router ID for protocols such as BGP and OSPF.
  • It is used as a source and destination address for testing network connectivity.
  • It can also be used for testing IP software.

Disadvantages:

  • Just like physical interfaces, it needs a unique address.

Although ping does not completely isolate problems, you can use it to help identify where a problem lies. When troubleshooting with ping, take the following steps:

1.

ping the IP address of your local loopback, using the command ping 127.0.0.1. If this command is successful, you know that the TCP/IP protocol suite is installed correctly on your system and functioning. If you are unable to ping the local loopback adapter, TCP/IP might need to be reloaded or reconfigured on the machine you are using.

The Loopback Address

The loopback is a special function within the protocol stack that is supplied for troubleshooting purposes. The Class A IP address 127.X.X.X is reserved for the loopback; although convention dictates that you use 127.0.0.1, you can use any address in the 127.X.X.X range, except for the network number itself (127.0.0.0) and the broadcast address (127.255.255.255). You can also ping by using the default hostname for the local system, which is called localhost (for example, ping localhost).


2.

ping the assigned IP address of your local network interface card (NIC). If the ping is successful, you know that your NIC is functioning on the network and has TCP/IP correctly installed. If you are unable to ping the local NIC, TCP/IP might not be bound correctly to the NIC or the NIC drivers might be improperly installed.

3.

ping the IP address of another known good system on your local network. By doing so, you can determine whether the computer you are using can see other computers on the network. If you can ping other devices on your local network, you have network connectivity.

If you cannot ping other devices on your local network and you were able to ping the IP address of your system, you might not be connected to the network correctly.

4.

After you've confirmed that you have network connectivity for the local network, you can verify connectivity to a remote network by sending a ping to the IP address of the default gateway.

5.

If you are able to ping the default gateway, you can verify remote connectivity by sending a ping to the IP address of a system on a remote network.

Using just the ping command in these steps, you can confirm network connectivity on not only the local network, but also on a remote network. The whole process requires as much time as it takes to type in the command, and you can do it all from a single location.

If you are an optimistic person, you can perform step 5 first. If that works, all the other steps will also work, saving you the need to test them. If your step 5 trial fails, you can go back to step 1 and start the troubleshooting process from the beginning.

by updated Aug 01, 2016

What happens when you ping a loopback address?

In a TCP/IP network, the loopback IP address is 127.0. 0.1, and pinging this address will always return a reply unless the firewall prevents it. The loopback address allows a network administrator to treat the local machine as if it were a remote machine. See ping, loopback plug and localhost.

What is a ping loopback test?

The ping command is used to verify the internal IP configuration on a local host. This test is accomplished by using the ping command on a reserved address called the loopback (127.0. 0.1). The loopback address, 127.0. 0.1, is defined by the TCP/IP protocol as a reserved address that routes packets back to the host.

Where can I find loopback address?

The loopback addresses are built into the IP domain system, enabling devices to transmit and receive the data packets. The loopback address 127.0. 0.1 is generally known as localhost. TCP/IP protocol manages all the loopback addresses in the operating system.

What is the command to ping the loopback address from a Windows command prompt?

Activity 1 - Ping Loopback Address 0.1: Open a command prompt. Type ping 127.0. 0.1 and press Enter.