# Networking Tools - Ping

At this stage, hopefully all of the theory has made sense and you now understand the basic models behind computer networking. For the rest of the room we're going to be taking a look at some of the command line networking tools that we can use in practical applications. Many of these tools do work on other operating systems, but for the sake of simplicity, I'm going to assume that you're running Linux for the rest of this room. The first tool that we're going to look at will be the `ping` command.

The ping command is used when we want to test whether a connection to a remote resource is possible. Usually this will be a website on the internet, but it could also be for a computer on your home network if you want to check if it's configured correctly. Ping works using the ICMP protocol, which is one of the slightly less well-known TCP/IP protocols that I mentioned earlier. The ICMP protocol works on the Network layer of the OSI Model, and thus the Internet layer of the TCP/IP model. The basic syntax for ping is `ping <target>`. In this example I am using ping to test whether a network connection to Google is possible:

![](https://muirlandoracle.co.uk/wp-content/uploads/2020/03/image-14.png)

Notice that the ping command actually returned the IP address for the Google server that it connected to, rather than the URL that I requested. This is a handy secondary application for ping, as it can be used to determine the IP address of the server hosting a website. One of the big advantages of ping is that it's pretty much ubiquitous to any network enabled device. All operating systems support it out of the box, and even most embedded devices can use ping!\\

Have a go at the following questions. Any questions about syntax can be answered using the man page for ping (`man ping` on Linux).

What command would you use to ping the bbc.co.uk website?

Ping muirlandoracle.co.uk\
What is the IPv4 address?

What switch lets you change the interval of sent ping requests?

What switch would allow you to restrict requests to IPv4?

What switch would give you a more verbose output?

[Answers](https://captmouse.gitbook.io/defense/getting-started/introductory-networking/networking-tools-ping/answers)
