Which of the following addresses can be ping to test the functionality of a network interface card?

An IP address is a string of characters separated by dots (periods (.)) or colons, depending on the version of IP you are using. In IPv4, this will be a string of 4 octets containing numbers from the decimal system. An example of an IPv4 address is:

192.168.0.1

IPv4 (Internet Protocol version 4) was standardized in 1980, and because the creators were not aware of how many devices would eventually be on the public network, or Internet, 40 years later we have started running low on unique IP addresses which may be used for public access.

In 1998, the IETF saw this limitation and the scarcity of unique addresses and created IPv6 (version 6). If you’re wondering what happened to v5, odd numbers are often used as test cases. IPv6 has been available to us for many years, but implementation has been slow. Therefore many companies are using both IPv4 and IPv6.

An IPv6 address consists of a string of hexadecimal characters that is 128 bits long and is also separated by colons. Each group of numbers is 16 bits, or 4 hex characters. An example of an IPv6 address is:

FE80:CD00:0000:0CDE:1258:0000:212E:729C

Types of IP Addresses

Public or Private

Types of IP addresses also depend on the version you’re using. In IPv4, there are two types of IP addresses, public and private. A device with a public IP address can be communicated with by people all over the world over the Internet. A public IP address must be unique, and generally these are leased to people or companies by an ISP (Internet Service Provider).

A private IPv4 address, on the other hand, is generally used within the local network of a company or home network. The addresses within those company or home networks are unique, however they are not unique among the entire world. Meaning if the laptop I’m using at home has the IPv4 address of 192.168.0.10, there may well be a device on another home or business network that is also on 192.168.0.10. However, there cannot be another device on my same network with that IP or communication won’t be possible. IPv6 addresses, though, are different in that there are so many available addresses that each device, no matter where it is, will have a unique address.

Private IPv4 addresses must fall in the following address spaces, though multiple networks may be carved out to form segments or IP ranges within these spaces.

Have you ever stopped to look at how much more ping can do for you beyond just a quick network connectivity test?

Posted: April 26, 2021 |%t min read| by Damon Garn

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Image by HeungSoon from Pixabay

I'm sure you recognize that

# ping localhost
# ping 127.0.0.1
1 is a common and relatively simple command. And, like many basic commands, there are some great options and techniques that make the tool even better. This article explores various tricks and tips to level up your
# ping localhost
# ping 127.0.0.1
1 knowledge.

I begin with some basic

# ping localhost
# ping 127.0.0.1
1 options and then interpret
# ping localhost
# ping 127.0.0.1
1 results. After that, I explore some advanced use cases. Finally, I cover some
# ping localhost
# ping 127.0.0.1
1 alternatives and additional approaches.

[ You might also like: Ping, traceroute, and netstat: The network troubleshooting trifecta ]

The basics

By way of quick review, you can simply enter the following two commands to test basic network connectivity to a remote machine with a hostname of server01 or an IP address of 192.168.2.200:

# ping server01
# ping 192.168.2.200

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Figure 1: Results of ping to 8.8.8.8

You can also test the local TCP/IP stack with either the localhost hostname or the loopback address:

# ping localhost
# ping 127.0.0.1

You can also use the

# ping localhost
# ping 127.0.0.1
6 command to
# ping localhost
# ping 127.0.0.1
1 the localhost:

# ping 0

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Figure 2: Ping the loopback address by using the ping 0 command.

Linux containers

  • A practical introduction to container terminology
  • Complimentary course: Deploying containerized applications
  • Download now: Red Hat OpenShift trial
  • eBook: Container storage for dummies
  • eBook: Podman in Action

Less well-known options

By default, Linux sends continuous pings. Windows, by default, only sends four. One of my favorite uses of

# ping localhost
# ping 127.0.0.1
1 is to inform me when a remote server or network device has restarted. For example, imagine I'm remotely connected to a Windows server from my Linux laptop. The server needs to be rebooted before I can continue with its configurations. I can issue the reboot command and then set up a continuous
# ping localhost
# ping 127.0.0.1
1 from my laptop to the server. When the
# ping localhost
# ping 127.0.0.1
1 results show success, I know the reboot process on the remote machine has been completed. In the meantime, I can work on other projects.

Note: The options for

# ping localhost
# ping 127.0.0.1
1 vary somewhat between Linux and Windows. Plan for this if you work with both platforms.

I can even use an audible cue with

# ping localhost
# ping 127.0.0.1
1, letting me know when the pings are successful.

# ping -a server01

You can adjust the number of pings by using the

# ping 0
3 option, followed by the desired number of
# ping localhost
# ping 127.0.0.1
1 messages. For example, to send five pings, type:

# ping -c 5 192.168.2.200

You can use a variation of this to simply display the IP address of the destination by sending a single

# ping localhost
# ping 127.0.0.1
1 to a hostname. This is a quick name resolution query:

# ping -c 1 server01

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Figure 3: A quick name resolution query by using a single ping.

Maybe you want to modify the level of detail

# ping localhost
# ping 127.0.0.1
1 returns? You can increase the detail level by adding the
# ping 0
7 (verbose) option or summarize the results by using the
# ping 0
8 (quiet) option.

# ping -v server01
# ping -c 1 -q server01

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Figure 4: Using the quiet mode with ping.

I've already uncovered some good uses for

# ping localhost
# ping 127.0.0.1
1 with the above options. I particularly like the ability do a quick name resolution query. I've used the continuous
# ping localhost
# ping 127.0.0.1
1 during reboots trick more than any other, however.

You can use the

# ping localhost
# ping 127.0.0.1
1 command to test name resolution services, too. If you
# ping localhost
# ping 127.0.0.1
1 a destination by IP address, and the
# ping localhost
# ping 127.0.0.1
1 succeeds, you know you have basic connectivity. If you
# ping localhost
# ping 127.0.0.1
1 the same destination by hostname, and it fails, you know name resolution is not working. This is because
# ping localhost
# ping 127.0.0.1
1 could not resolve the given hostname to an IP address in the second test.

Results and techniques

Delving a little deeper into the results, the

# ping localhost
# ping 127.0.0.1
1 output displays the hostname and IP address information, packet loss, response times, etc.

Output from ping

The two most common results to watch for are timeout and unknown host. Both of these indicate a failure, but did you know that you can use these two results to predict where the network problem lies?

The timeout message indicates that your machine believes it successfully sent

# ping localhost
# ping 127.0.0.1
1 queries to the destination. However, it did not receive replies within a specified time, so it "timed out." The misconfiguration is likely on the destination end or on the network between your machine and the destination. Your machine sent the queries, but the destination failed to reply. Start by checking that the destination device is on, physically connected to the network, and has a valid IP address. Verify router and firewall configurations after that.

The opposite is true with the unknown host output. This indicates a likely issue on your end of the connection. Your computer was unable to send the query out to the desired destination. This could mean an IP address misconfiguration on your end, a problem with the default gateway value, or that you're attempting to connect to a destination address that doesn't exist.

Work outward in

Many networking courses suggest that you use

# ping localhost
# ping 127.0.0.1
1 to test for configuration problems by pinging the nearest configurations first, working your way outward. I've always disagreed with this.

The nearest addresses first approach looks like this:

  1. Loopback:
    # ping -a server01
    9
  2. Localhost:
    # ping -c 5 192.168.2.200
    0
  3. Local router/default gateway:
    # ping -c 5 192.168.2.200
    1
  4. Remote destination by IP address:
    # ping -c 5 192.168.2.200
    2
  5. Remote destination by hostname:
    # ping -c 5 192.168.2.200
    3

I find it's more efficient to use the outward in approach because if step 1 succeeds, I can move on to other tests without wasting time. The chances of loopback and localhost tests failing are very low compared to other network configuration problems.

Here is the outward in approach:

  1. Remote destination by hostname:
    # ping -c 5 192.168.2.200
    3 (Note: If this succeeds, move on to other network tests)
  2. Remote destination by IP address:
    # ping -c 5 192.168.2.200
    2
  3. Local router/default gateway:
    # ping -c 5 192.168.2.200
    1
  4. Localhost:
    # ping -c 5 192.168.2.200
    0
  5. Loopback:
    # ping -a server01
    9

More about cloud services

  • What is hybrid cloud?
  • eBook: Modernize your IT with managed cloud services
  • Try for 60 days: Red Hat OpenShift Dedicated
  • eBook: Hybrid cloud strategy for dummies

Advanced use cases

There are several miscellaneous

# ping localhost
# ping 127.0.0.1
1 commands you can use for various tests.

For example, what if you don't have Nmap installed but need to see what hosts are up? Add the

# ping -c 1 server01
0 option to run a
# ping localhost
# ping 127.0.0.1
1 broadcast to an entire subnet. This displays the hosts that are currently up, thought it's not as effective as a simple Nmap scan.

# ping -b -c 3 -i 20 192.168.2.255

You can also change the size of the

# ping localhost
# ping 127.0.0.1
1 packet payload. The header is always 28 bytes, so add on the amount you want plus 28 bytes to get the total size. The default is 64 bytes. To send a
# ping localhost
# ping 127.0.0.1
1 with 128 bytes, type the following:

# ping -s 100 server01

This is the basic technique used in Ping of Death attacks.

Limit the number of hops (routers) the

# ping localhost
# ping 127.0.0.1
1 will pass through by configuring a time-to-live (TTL) value. For example, to limit the query to ten hops, type:

# ping -t 10 server01

In addition, while doing a continuous

# ping localhost
# ping 127.0.0.1
1, try Ctrl+pipe to display statistics.

Final tricks

I'll wrap up with one final tool and a reminder about routers.

There is a GUI for

# ping localhost
# ping 127.0.0.1
1 -
# ping -c 1 server01
7. Using a GUI could be handy for tasks like monitoring rebooting servers, as mentioned above. From across the room, you could view the status of a continuous
# ping localhost
# ping 127.0.0.1
1 result. Sometimes a graphical view is just easier to work with or useful for demonstrations. You can find
# ping -c 1 server01
7 at its official Git page. It's available for various Linux distributions, macOS, and Windows. There are several different package types available for several other installers.

Here are a couple of

# ping -c 1 server01
7 syntax examples. The first establishes a graphical ping to server01, and the second displays the
# ping -c 1 server01
7 help:

# ping localhost
# ping 127.0.0.1
0

Here is a screenshot of

# ping -c 1 server01
7 testing connectivity to the 8.8.8.8 address.

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Figure 5: The gping 8.8.8.8 results.

Finally, a reminder: Many routers are set to drop ICMP-based packets, such as those used by

# ping localhost
# ping 127.0.0.1
1 (and
# ping -v server01
# ping -c 1 -q server01
4). ICMP, in general, can be used for various attacks, and so routers may be configured neither pass nor respond to
# ping localhost
# ping 127.0.0.1
1 requests. This is something to keep in mind while troubleshooting network connectivity.

[ Free download: Advanced Linux commands cheat sheet. ] 

Wrap up

Sure,

# ping localhost
# ping 127.0.0.1
1 is a simple tool that you've all worked with a lot, but there are some great options to modify its behavior and some good techniques to use when troubleshooting. Did you discover at least one useful thing you didn't know from the above list? And how about
# ping -c 1 server01
7? Can you think of any good uses for a graphical version of
# ping localhost
# ping 127.0.0.1
1? 

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

My go-to Linux network troubleshooting commands

Every sysadmin needs a good troubleshooting strategy, and you can't fix a problem if you cannot identify it. These are my favorite commands to quickly filter through the possibilities of a given problem.

Posted: November 29, 2019

Author: Tyler Carrigan (Editorial Team, Red Hat)

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

A beginner's guide to network troubleshooting in Linux

Every system administrator needs to have at least a basic understanding of network troubleshooting. And the first rule of network troubleshooting to remember is, "Packets don't lie."

Posted: September 24, 2019

Author: Anthony Critelli (Sudoer)

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Packet sniffer basics for network troubleshooting

Capturing packets with a free tool like tcpdump is an essential skill that you need to acquire as a sysadmin. Anthony Critelli shows you the ropes.

Posted: November 19, 2019

Author: Anthony Critelli (Sudoer)

Topics:   Networking   Linux administration   Troubleshooting  

Which of the following addresses can be ping to test the functionality of a network interface card?

Damon Garn

Damon Garn owns Cogspinner Coaction, LLC, a technical writing, editing, and IT project company based in Colorado Springs, CO. Damon authored many CompTIA Official Instructor and Student Guides (Linux+, Cloud+, Cloud Essentials+, Server+) and developed a broad library of interactive, scored labs. He regularly contributes to Enable Sysadmin, SearchNetworking, and CompTIA article repositories. Damon has 20 years of experience as a technical trainer covering Linux, Windows Server, and security content. He is a former sysadmin for US Figure Skating. He lives in Colorado Springs with his family and is a writer, musician, and amateur genealogist. More about me

Red Hat Summit 2022: On Demand

Get the latest on Ansible, Red Hat Enterprise Linux, OpenShift, and more from our virtual event on demand.

Register for free

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Top 22 sysadmin guides and tutorials of 2022

Enable Sysadmin's top articles of the year include a lot of Linux commands, automation tips, container strategies, troubleshooting, and more.

Posted: December 30, 2022

Author: Vicki Walker (Editorial Team, Red Hat)

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Top 10 sysadmin troubleshooting guides of 2022

Find solutions to your Linux, Kubernetes, Ansible, and other systems problems in Enable Sysadmin's top troubleshooting articles.

Posted: December 28, 2022

Author: Tyler Carrigan (Editorial Team, Red Hat)

Image

Which of the following addresses can be ping to test the functionality of a network interface card?

Top 10 tutorials for Linux administrators of 2022

Get some tips and tricks to help you become a better sysadmin from Enable Sysadmin's community of writers.

Which of the following addresses can be pinged to test the functionality of a network interface card?

Ensure that the NIC is functional and the TCP/IP protocol is installed and functional by pinging the loopback address 127.0. 0.1.

What command is used on a router to identify the routes of which the router is aware?

Traceroute – The traceroute command is used to determine the path between two connections. Often a connection to another device will have to go through multiple routers.

Which of the following is the first place a computer looks at during the name resolution process?

Even though the HOSTS file is rarely used today, it is still the first place that a computer looks at during the name resolution process. A computer contacts the DNS server if it is unable to find a match in the local HOSTS file.

Which command ensures the system files are all intact?

Techopedia Explains Check Disk (chkdsk) In most operating systems, admins have the options for what switches to execute with the Check Disk command. The main functionality of Check Disk is to ensure the system or administrative information regarding files, folders and similar data stored in a physical disk is correct.