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: Show
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 AddressesPublic or PrivateTypes 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 Image by HeungSoon from Pixabay I'm sure you recognize that 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 1 knowledge.I begin with some basic 1 options and then interpret 1 results. After that, I explore some advanced use cases. Finally, I cover some 1 alternatives and additional approaches.[ You might also like: Ping, traceroute, and netstat: The network troubleshooting trifecta ] The basicsBy 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:
Image You can also test the local TCP/IP stack with either the localhost hostname or the loopback address:
You can also use the 6 command to 1 the localhost:
Image Linux containers
Less well-known optionsBy default, Linux sends continuous pings. Windows, by default, only sends four. One of my favorite uses of 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 1 from my laptop to the server. When the 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 1 vary somewhat between Linux and Windows. Plan for this if you work with both platforms.I can even use an audible cue with 1, letting me know when the pings are successful.
You can adjust the number of pings by using the 3 option, followed by the desired number of 1 messages. For example, to send five pings, type:
You can use a variation of this to simply display the IP address of the destination by sending a single 1 to a hostname. This is a quick name resolution query:
Image Maybe you want to modify the level of detail 1 returns? You can increase the detail level by adding the 7 (verbose) option or summarize the results by using the 8 (quiet) option.
Image I've already uncovered some good uses for 1 with the above options. I particularly like the ability do a quick name resolution query. I've used the continuous 1 during reboots trick more than any other, however.You can use the 1 command to test name resolution services, too. If you 1 a destination by IP address, and the 1 succeeds, you know you have basic connectivity. If you 1 the same destination by hostname, and it fails, you know name resolution is not working. This is because 1 could not resolve the given hostname to an IP address in the second test.Results and techniquesDelving a little deeper into the results, the 1 output displays the hostname and IP address information, packet loss, response times, etc.Output from pingThe 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 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 inMany networking courses suggest that you use 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:
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:
More about cloud services
Advanced use casesThere are several miscellaneous 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 0 option to run a 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.
You can also change the size of the 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 1 with 128 bytes, type the following:
This is the basic technique used in Ping of Death attacks. Limit the number of hops (routers) the 1 will pass through by configuring a time-to-live (TTL) value. For example, to limit the query to ten hops, type:
In addition, while doing a continuous 1, try Ctrl+pipe to display statistics.Final tricksI'll wrap up with one final tool and a reminder about routers. There is a GUI for 1 - 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 1 result. Sometimes a graphical view is just easier to work with or useful for demonstrations. You can find 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 7 syntax examples. The first establishes a graphical ping to server01, and the second displays the 7 help: 0Here is a screenshot of 7 testing connectivity to the 8.8.8.8 address.Image Finally, a reminder: Many routers are set to drop ICMP-based packets, such as those used by 1 (and 4). ICMP, in general, can be used for various attacks, and so routers may be configured neither pass nor respond to 1 requests. This is something to keep in mind while troubleshooting network connectivity.[ Free download: Advanced Linux commands cheat sheet. ] Wrap upSure, 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 7? Can you think of any good uses for a graphical version of 1? Check out these related articles on Enable SysadminImage 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 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 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 Damon GarnDamon 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 DemandGet the latest on Ansible, Red Hat Enterprise Linux, OpenShift, and more from our virtual event on demand. Register for free Related ContentImage 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 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 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.
|