1 00:00:00,000 --> 00:00:01,260 [No audio] 2 00:00:01,260 --> 00:00:05,730 traceroute, trace the network traffic. 3 00:00:06,360 --> 00:00:09,930 So in this lesson, we are actually going 4 00:00:09,930 --> 00:00:12,690 to learn and try to understand how we 5 00:00:12,690 --> 00:00:15,900 could troubleshoot the network issues if 6 00:00:15,900 --> 00:00:18,000 we are having any network issue in our 7 00:00:18,000 --> 00:00:20,490 environment. And one of the commands 8 00:00:20,490 --> 00:00:24,180 that is mostly used to see where your 9 00:00:24,180 --> 00:00:27,900 traffic is going, which gateway or which 10 00:00:27,900 --> 00:00:31,290 DNS server, it's going from one to 11 00:00:31,290 --> 00:00:33,720 another to the third, and finally, how 12 00:00:33,750 --> 00:00:36,120 is it going to reach its destination. 13 00:00:36,780 --> 00:00:42,090 And to view that entire tracing of 14 00:00:42,090 --> 00:00:44,370 those network traffic, you have to use a 15 00:00:44,370 --> 00:00:47,520 command traceroute. And this is a 16 00:00:47,520 --> 00:00:50,070 command I believe it is also available 17 00:00:50,100 --> 00:00:52,740 in other operating systems as well. In 18 00:00:52,740 --> 00:00:55,916 Windows I believe it's called tracert. 19 00:00:55,916 --> 00:00:59,100 I'm not sure exactly what is the 20 00:00:59,100 --> 00:01:01,770 command in Mac or other operating 21 00:01:01,770 --> 00:01:04,260 system. Anyway, we our focus is Linux. 22 00:01:04,260 --> 00:01:08,760 So let's see what traceroute does. The 23 00:01:08,760 --> 00:01:11,850 traceroute command is used in Linux to 24 00:01:11,850 --> 00:01:14,790 map the journey that a packet of 25 00:01:14,790 --> 00:01:16,980 information undertakes from its source 26 00:01:16,980 --> 00:01:20,820 to its destination. One use of 27 00:01:20,820 --> 00:01:24,030 traceroute is to locate when data loss 28 00:01:24,060 --> 00:01:26,550 occurs throughout a network, which would 29 00:01:26,550 --> 00:01:30,690 signify a node that's 30 00:01:30,690 --> 00:01:34,890 down. So as it says, if you just need to 31 00:01:34,890 --> 00:01:37,740 find the tracing from source to 32 00:01:37,740 --> 00:01:40,350 destination, how the packet went through 33 00:01:40,350 --> 00:01:44,940 from one to another. Because each hop in 34 00:01:44,940 --> 00:01:46,890 the record reflects a new server or 35 00:01:46,890 --> 00:01:49,380 router between the originating PC and 36 00:01:49,380 --> 00:01:51,540 intended target, reviewing the results 37 00:01:51,540 --> 00:01:53,910 of traceroute scan also lets you 38 00:01:53,910 --> 00:01:56,190 identify slow points that may 39 00:01:56,190 --> 00:01:59,580 adversely, that may adversely affect your 40 00:01:59,580 --> 00:02:02,010 network traffic. So it could be many 41 00:02:02,010 --> 00:02:03,750 different PCs, or many different 42 00:02:03,750 --> 00:02:05,850 machines or gateways in the middle while 43 00:02:05,850 --> 00:02:08,520 your traffic is flowing, that affect 44 00:02:08,610 --> 00:02:12,000 your traffic flow. And that's how 45 00:02:12,000 --> 00:02:14,190 once you know, hey, I know this is the 46 00:02:14,220 --> 00:02:17,370 machine that is the troubled machine 47 00:02:17,370 --> 00:02:20,430 that is causing my network traffic to 48 00:02:20,430 --> 00:02:23,100 fail, you can find that out if why by 49 00:02:23,100 --> 00:02:25,830 running the command traceroute. Now, 50 00:02:25,890 --> 00:02:30,077 the command itself is just simple traceroute, 51 00:02:30,077 --> 00:02:33,780 and the destination hostname or 52 00:02:33,810 --> 00:02:37,260 the IP address or the URL in this case. 53 00:02:37,440 --> 00:02:40,020 So if you are trying to go to a URL, let's say 54 00:02:40,020 --> 00:02:43,230 google.com, hotmail.com, facebook.com, or 55 00:02:43,230 --> 00:02:45,660 wherever you are going, or if you are in 56 00:02:45,660 --> 00:02:48,420 your local environment in your corporate 57 00:02:48,420 --> 00:02:50,520 world, you probably have an IP or a 58 00:02:50,520 --> 00:02:52,680 hostname of your machine, then you could 59 00:02:52,680 --> 00:02:56,100 run traceroute space, the hostname as 60 00:02:56,100 --> 00:02:57,960 long as your machine or where 61 00:02:57,960 --> 00:03:00,060 you are running the traceroute can 62 00:03:00,060 --> 00:03:03,060 resolve that hostname to IP. If it 63 00:03:03,060 --> 00:03:06,990 cannot then make sure you put in the IP 64 00:03:06,990 --> 00:03:09,900 address. Okay, let's get into my Linux 65 00:03:09,900 --> 00:03:12,870 machine. And then we will try this 66 00:03:12,930 --> 00:03:16,274 traceroute command on it and see how it works. 67 00:03:16,274 --> 00:03:18,743 So I will go into 68 00:03:20,505 --> 00:03:22,830 my console. And 69 00:03:22,830 --> 00:03:25,140 first thing, I want to make sure I am 70 00:03:25,140 --> 00:03:28,590 online. So I could just do ping any 71 00:03:28,590 --> 00:03:30,900 website. So you'll see I'm getting a 72 00:03:30,900 --> 00:03:34,080 response back. So I am online, so now 73 00:03:34,080 --> 00:03:38,670 let's run the command traceroute. Now, 74 00:03:38,880 --> 00:03:42,060 when you run it, you have to specify the 75 00:03:42,090 --> 00:03:44,580 hostname if you are in your environment, 76 00:03:44,910 --> 00:03:46,950 in a corporate environment, and you are 77 00:03:47,160 --> 00:03:50,730 running your infrastructure and you 78 00:03:50,730 --> 00:03:52,380 probably have a lot of servers, you will 79 00:03:52,380 --> 00:03:54,420 have to specify the hostname if it can 80 00:03:54,420 --> 00:03:56,670 resolve it, otherwise the IP address. 81 00:03:57,090 --> 00:03:59,610 But for us, since we are using the lab 82 00:03:59,610 --> 00:04:02,460 environment, we'll just do google.com 83 00:04:02,490 --> 00:04:05,070 and hit enter. And you will see the 84 00:04:05,070 --> 00:04:08,370 first hop it is going to do is, it is going 85 00:04:08,370 --> 00:04:11,760 to jump on to our modem. This is my 86 00:04:11,760 --> 00:04:14,580 modem which is also a gateway to my 87 00:04:14,580 --> 00:04:18,060 traffic. So the first hop it is doing is 88 00:04:18,060 --> 00:04:20,910 going to my modem. And this is the time 89 00:04:20,940 --> 00:04:23,970 it takes to go there. And it didn't 90 00:04:24,360 --> 00:04:26,579 cause any issue. If there was any 91 00:04:27,570 --> 00:04:29,790 hang time there, it will tell you this 92 00:04:29,790 --> 00:04:32,430 is going to take that much long time to 93 00:04:32,430 --> 00:04:34,620 go to the second hop. Second hop is 94 00:04:34,620 --> 00:04:36,450 going to another gateway right here, 95 00:04:36,450 --> 00:04:39,840 which is most likely my NAT IP which is 96 00:04:39,840 --> 00:04:42,330 the internet IP address or the internet, 97 00:04:42,690 --> 00:04:46,320 IP, the gateway IP and then it will tell 98 00:04:46,320 --> 00:04:48,720 you it did 1,2, all the way through 99 00:04:48,720 --> 00:04:52,320 to 14 hops to get to this IP address 100 00:04:52,320 --> 00:04:55,230 which is the result IP address of 101 00:04:55,260 --> 00:04:57,990 google.com. So this is how you could 102 00:04:57,990 --> 00:05:00,870 actually use the traceroute utility to 103 00:05:00,870 --> 00:05:03,420 find out how your traffic flows from 104 00:05:03,420 --> 00:05:06,450 your source to the destination. The 105 00:05:06,450 --> 00:05:09,600 reason it went to my gate at first is 106 00:05:09,600 --> 00:05:11,760 because that's how my gateway is 107 00:05:11,760 --> 00:05:13,830 defined. And to find out your gateway, 108 00:05:13,830 --> 00:05:18,279 you can run the command netstat -rnv, 109 00:05:18,279 --> 00:05:20,760 and you will see the gateway I have 110 00:05:20,760 --> 00:05:24,030 for all my traffic should flow from the 111 00:05:24,030 --> 00:05:27,540 gateway 192.168.1.1. It might be 112 00:05:27,540 --> 00:05:29,610 different in your environment, depending 113 00:05:29,610 --> 00:05:31,080 on which environment you're working on. 114 00:05:31,110 --> 00:05:34,020 And whether you are doing this lesson 115 00:05:34,020 --> 00:05:36,960 through your work, then you will have a 116 00:05:36,960 --> 00:05:38,490 different one. If you are doing from home 117 00:05:38,490 --> 00:05:40,230 then most likely you will have the same 118 00:05:40,260 --> 00:05:42,780 IP address as your gateway. So this is 119 00:05:42,780 --> 00:05:44,610 about the traceroute. Try to find it, 120 00:05:44,970 --> 00:05:47,340 how you could troubleshoot, many times 121 00:05:47,340 --> 00:05:49,290 people also ask what are the different 122 00:05:49,290 --> 00:05:50,940 ways you could troubleshoot networking 123 00:05:50,940 --> 00:05:52,830 related issue in the operating system. 124 00:05:53,070 --> 00:05:55,950 So you could also bring up this 125 00:05:55,980 --> 00:05:58,950 traceroute command and this is one of 126 00:05:58,950 --> 00:06:02,580 the main command that will help you 127 00:06:02,580 --> 00:06:04,650 troubleshoot network related issues. 128 00:06:04,650 --> 00:06:07,573 [No audio]