Command Line Commands (part 1) - Using the ping and tracert commands

Video Activity

Using the ping and tracert commands This lesson discusses using the ping and tracert commands in the Windows command line to troubleshoot network issues. Ping: used to ping a system and get a response back; simple to use. Tracert: cam be used to discover what's causing a 'bottleneck' on a network

Join over 3 million cybersecurity professionals advancing their career
Sign up with
or

Already have an account? Sign In »

Time
31 hours 29 minutes
Difficulty
Beginner
CEU/CPE
30
Video Description

Using the ping and tracert commands This lesson discusses using the ping and tracert commands in the Windows command line to troubleshoot network issues.

  • Ping: used to ping a system and get a response back; simple to use.
  • Tracert: cam be used to discover what's causing a 'bottleneck' on a network
Video Transcription
00:04
So we talked about a couple of different software that we can get installed on our computer. We can place on our device in order to troubleshoot network and activity. But we already have a couple of pieces of software preinstalled on our Windows command line that can allow us to do this connective ity. Allow us to troubleshoot these issues. And this is
00:23
through our through our command line. Through our Windows Command prompt,
00:27
we can use these already installed tools. He's already installed commands in order to troubleshoot some network issues. Now, most of the command that we're gonna talk about are going to be mostly our Windows command line. But we will talk about a couple tools that also apply to our UNIX and Lennox based command terminals
00:46
UNIX, Lennox and Mac OS space command terminals.
00:49
But again, most of these air going to be our Windows command line unless otherwise specified.
00:54
So our first command is going to be our pain command. Now, when we run a ping command are ping are
01:00
Ping command is going to send an ICMP echo request to a target and wait for a response back.
01:07
So essentially, what a ping command does is we have our host computer and we have our destination. Computer
01:14
on our host computer is simply trying to see if it can reach this computer and its target. And if it can get a response back, it's one of the most is one of the simplest forms for us to see if we can connect to a target. If we can talk to a potential target
01:32
Now, when we issue a ping command, we had to have to realize that some devices do not respond to ICMP echo requests for security or performance reasons. So we do need to make sure that the device that we're trying to target the device that we're trying to send a ping request towards does allow us tow receive ICMP echo request back.
01:51
Now we will issue a pain command.
01:55
We will tie pin in our command line open of our command front and type in ping
02:00
followed by an I P address or a host name, so we can do ping
02:06
1 92.1 68.1 dot 12.
02:09
Or, if we know the host name computer, we could also try paying admin that local
02:17
trying to pin ping the admin machine on the local domain. Ping can also be a good tool for us in order to see if where our computer is successfully doing being s look ups. If we try to paying a target by host name and it doesn't work, so we try to paying a server by the server name and it isn't able to ping the server.
02:36
But then we try pinging the server by its I p address and it does work.
02:38
Then we know there's probably something going on with our d n s with their d. N s having issues or d n s setting. So we will want to check those. Now we do have a couple of additional options that we can set for our ping requests. These additional options give us additional functionality for our ping command.
02:55
We first have the dash t so we would do something like Ping
03:00
dash t
03:01
admin dot local or 1 92
03:06
that 1 68.1 dot 12.
03:10
Now we throw in the dash T that's going to Ping until we we hit a break and that break will be us to doing some be entering a computer break such as control. See now Windows computers By default.
03:23
We're only paying with paying four times and then stop
03:27
unless we throw in this dash T where, well, paying until we do a manual brake
03:32
if we're looking on, if we're using a Linux or UNIX computer and we do a pain command, a Linux or UNIX computer will paying by default until we break or unless we specify the number of pinks. So if we don't specify, a number of pings on a Windows command line will only paying four times.
03:52
If we don't specify a number of pings on a UNIX or Lennox command shell,
03:55
then we'll we'll just keep pinging until we manually brake. So that's one of our differences there. But in Windows are Windows Command line. If we do a ping dash T, our computer will try to paint a target until we break. This would be good if we're trying to troubleshoot a say we had a certain server or we have a connection to the Internet,
04:15
which intermittently goes up and down,
04:16
and we want to show that, and we want to see how much how much percentage of the time we're down or not able to connect to this device. Then we could bring up. We could have a computer. We could have a work station doing a Ping Dashti to a destination either on the Internet or locally, and then
04:34
do something called piping and take the take the output for this command
04:40
and pipe it to, say a text document.
04:42
And then we can just let that run, say, for an hour or two hours and then stopped manually. Stop it, Open up the text document and then see what? How looked through that text document and see how much up time and how much downtime that we have. So it's ah, it's a good manual tool to use in order to check that out.
05:01
Next, we have our dash a option. Now our dash a option will attempt to resolve Host named are the I. P. Address to host name so or the other way around. So will tempt to well, essentially attempt to resolve this 1 92.1 68 not 1.12 to a host name of that computer. So
05:20
keep that in mind if you do, If you want to paying a computer and you want to say, Okay,
05:26
well, what's the host name of this computer, then that dash a option So paying Dash A 1 92.1 68.1 dot 12 will respond back with it when it comes back and brings us the result. If it's able to, it will show us the hosting. If it's not, it will just respond back with the I P address again.
05:46
And then, lastly, we have dash in and followed by a number this will give us a number of pain, will be able to set the number of pain attempts that we want to try. So rather than Ping until we break, we can say Okay, I'm gonna ping dash in and then say 400
06:04
and then our computer will attempt to paying 400 times to the address that we specify. So again, that's our pain command. It's one of the simple ways that we can try to see if we're able to establish connective ity to an object. Say, if we're having connective ity issues between us and a server, and there's several hops between that server, several
06:24
several different routers or several
06:26
additional destinations that we hit before we get to that server. What we can do is we can try pinging each of those individually seeing if we can get to each of those individual hops and then see which one we can't get to.
06:38
Or rather than doing that, we can do our next command, which is trace our tea.
06:44
One word. Now this trace our T stands for trace route. And what is going to do? Is this essentially going to go to each stop between us and our destination and let us know if we're able to hit that destination? So say we aren't able to connect to an end point destination and we're trying to figure out what the issue is
07:02
or we are able to connect to an end point destination.
07:05
But there's kind of a bottleneck between us and that destination. Somewhere somewhere, there's a slowdown. There's a bottleneck occurring, so we want to see if we can figure out where that bottleneck is. Well, trace route is gonna be gonna be our command that we're gonna want to turn to. So what our trace route command is going to do is it's going to go to each of those hops
07:23
had been. Let us know back how long we spend at each of those hops,
07:27
how long it takes for us to go on to the next destination. This gives us a lot of insight to our connection between us and an endpoint, because not only will let us see if we aren't able to move past a certain point, obviously narrowing down our issue to that that either that node,
07:43
that object or the next place that's supposed to go to there's a connection problem between
07:47
that. Hop in the next one, or it'll let us know if there's a bottleneck. If there's a place where we have apparently a lot of traffic converging or we have maybe some issues going on with that particular device that we need to troubleshoot this, causing a slowdown in the connection through that device, it will also let us see how much time we're spending at that particular device.
08:07
Now we do have eso with our trace route command. We would just simply right in
08:13
our type in rather into our command line, trace our T all one word and then an address host name or address so we could just do 1 92 are we could do, uh, we'll do a public address
08:24
and we could just do 8.88 dot eight.
08:30
We could have a public address there.
08:31
Now, if we do a dash D and tack that onto our trace route, that's going to tell our trace route. Do not resolve.
08:39
So we're telling were essentially saying, We don't want to resolve the I. P address I p addresses tau host names. We run a trace route command trace route by default will attempt to take all of the I P addresses that it returns to us and resolve those to their host names. Now, while this makes it easier for us to read and easier for us to see what each hop is,
08:58
it takes a lot longer for trace route to return back because it's trying to resolve those I p addresses to host names.
09:03
And if it can't, that's only when it resolved. I p addresses. So if we want to run trace route a little bit faster, or maybe we want to actually see the I P addresses, we don't want to see the host names that it's returning. Then we'll tack on a dash d to our trace out command. And remember this as Do not resolve I p address.
09:22
Next we have our dash h. Now, by the fall, trace route will go over a maximum. A maximum of 30 hops. Essentially, ah, hop is each location that we hit. That each new location we hit as we're getting to our in point and we'll go over, it will trace a maximum of 30 hops.
09:41
Now, if we don't want to see that many, maybe one. We want to cut it down to the 1st 5 hops. Then we can set dash H
09:48
now again. Just because we set Dash H for setting the number of hops does not mean we can exceed that maximum of 30. We can't set a trace route desh h 35 then see 35 hops. That's not how it works. We could weaken. Set that to a maximum of 30
10:05
and dash h will allow us to set. Say, if we want something lower we want in the 1st 5
10:11
so we could do a trace route. Dash H.
10:13
I'll do 10 and then our I p address that we want to result that we want to try to get to so that dash
10:20
H is gonna let us narrow down what portion of our trace route we're gonna actually see.
10:26
Now, our last
10:28
option here isn't actually an option. This *** trick, it essentially means this at this *** trick just means that
10:37
what? Something that we may get back in our return. When we're looking at our trace route prompt back, we may see a line where we aren't getting any information back. We're just getting *** tricks now. That could mean one of two. That could mean a couple things.
10:50
Simply put, this *** trick means that we're not getting that. The device that we're trying to hit is not acknowledging our packet. Now, this could mean that we can't connect to that device. We're trying to get to that next top, and we just can't get there. So it could mean we don't have connectivity there, Or it could just mean that that device is configured not to respond back to our trace route commands.
11:11
Well, why would a device do that?
11:13
Well again for security or performance reasons? Maybe we a certain website or certain server doesn't want us to be able to see the I P addresses between us and a server. It doesn't want us to know those I p addresses because they could be additional attack surfaces that we could try to hit so they obscure them by not responding back to this trace route.
11:33
So we'll get those Asterix
11:33
we may get certainly may get several lines of hops and then ash a couple *** trick lines and then get enough and get it. Then get our final server destination, letting us know. Oh, yeah, we got there. But we're not going to show you anything. Well, it's the networks. I'm trying to connect to the devices I'm asking for. The information are not showing me this information.
11:54
So if we can paying a certain location say we try a paying 28 dot a dot a 28.0.0.8 and we get there successfully, we get a response back, and then we try a trace route to that same device and then halfway through, we just get *** tricks then that doesn't mean that we're not able to connect anymore. If we can still paying the device,
12:11
then we can still we still have a connection.
12:13
If we get a pain response, we get a ping response back with no connection loss. That means we're still connected.
12:20
The *** tricks just simply mean that those devices are configured somewhere in between us and the in client certain devices that configure not to respond back with their information.
Up Next
CompTIA Network+

This CompTIA Network+ certification training provides you with the knowledge to begin a career in network administration. This online course teaches the skills needed to create, configure, manage, and troubleshoot wireless and wired networks.

Instructed By