1 00:00:00,320 --> 00:00:02,100 In this video, we're going to cover 2 00:00:02,100 --> 00:00:05,550 the ipconfig, ifconfig, and ip command line tools 3 00:00:05,550 --> 00:00:07,680 and how we use them in maintaining and troubleshooting 4 00:00:07,680 --> 00:00:08,670 our networks. 5 00:00:08,670 --> 00:00:10,590 First, we have ipconfig. 6 00:00:10,590 --> 00:00:13,650 ipconfig, or IP configuration is used to display 7 00:00:13,650 --> 00:00:16,920 all of the current TCP/IP network configuration values 8 00:00:16,920 --> 00:00:19,950 and refreshes the DHCP and DNS settings 9 00:00:19,950 --> 00:00:21,990 for a Windows client or server. 10 00:00:21,990 --> 00:00:24,210 If you enter ipconfig at the command prompt, 11 00:00:24,210 --> 00:00:26,280 you're going to get some basic information back 12 00:00:26,280 --> 00:00:28,470 about the TCP/IP network configuration 13 00:00:28,470 --> 00:00:30,660 in use by your Windows client. 14 00:00:30,660 --> 00:00:33,990 In this example, you can see my IPv6 link local address, 15 00:00:33,990 --> 00:00:37,350 my IPv4 address of 10.0.2.15, 16 00:00:37,350 --> 00:00:41,250 my subnet mask of 255.255.255.0, 17 00:00:41,250 --> 00:00:44,610 and my default gateway of 10.0.2.2. 18 00:00:44,610 --> 00:00:46,320 There isn't a whole lot of details here, 19 00:00:46,320 --> 00:00:48,510 but it does give you the basics. 20 00:00:48,510 --> 00:00:51,030 Now, for example, if I entered ipconfig 21 00:00:51,030 --> 00:00:55,280 and my IP address was listed as 169.254.132.51, 22 00:00:56,580 --> 00:00:58,830 that would indicate I have a DHCP issue 23 00:00:58,830 --> 00:01:01,350 because my computer is now assigned an APIPA address 24 00:01:01,350 --> 00:01:04,050 or Automatic Private IP Address value. 25 00:01:04,050 --> 00:01:06,930 Now, if this was the case, I could try to get a new IP 26 00:01:06,930 --> 00:01:08,610 by releasing and renewing my connection 27 00:01:08,610 --> 00:01:10,470 or by rebooting my machine. 28 00:01:10,470 --> 00:01:11,610 If that doesn't work, 29 00:01:11,610 --> 00:01:13,680 then I can troubleshoot the DHCP server 30 00:01:13,680 --> 00:01:15,930 and ensure that it's functioning properly. 31 00:01:15,930 --> 00:01:17,730 To release the current IP address, 32 00:01:17,730 --> 00:01:20,820 you have to enter the ipconfig /release command 33 00:01:20,820 --> 00:01:21,960 and hit enter. 34 00:01:21,960 --> 00:01:23,340 At this point, you're going to see 35 00:01:23,340 --> 00:01:25,410 your IP configuration displayed again, 36 00:01:25,410 --> 00:01:29,070 this time showing you have no IPv4 address, no subnet mask, 37 00:01:29,070 --> 00:01:31,050 and no default gateway assigned. 38 00:01:31,050 --> 00:01:33,210 To attempt to get a new DHCP address, 39 00:01:33,210 --> 00:01:35,640 you're going to enter ipconfig /renew, 40 00:01:35,640 --> 00:01:37,110 and then you press enter. 41 00:01:37,110 --> 00:01:40,320 Now you're going to get an IPv4 address, a subnet mask, 42 00:01:40,320 --> 00:01:43,320 and a default gateway assigned through the DHCP DORA 43 00:01:43,320 --> 00:01:46,860 or Discover, Offer, Request, and Acknowledge process. 44 00:01:46,860 --> 00:01:49,350 Now, you may remember that DHCP actually gives up 45 00:01:49,350 --> 00:01:51,270 a bit more information though, right? 46 00:01:51,270 --> 00:01:53,310 What is our DNS servers IP address? 47 00:01:53,310 --> 00:01:56,190 When is my lease going to be obtained and when does it expire? 48 00:01:56,190 --> 00:01:57,630 How can I find my Mac address 49 00:01:57,630 --> 00:01:59,100 if I need to know the physical address 50 00:01:59,100 --> 00:02:01,500 for some kind of troubleshooting of Layer 2 issues? 51 00:02:01,500 --> 00:02:03,750 All of these details simply aren't being displayed 52 00:02:03,750 --> 00:02:06,360 when I type in ipconfig and hitting enter though, 53 00:02:06,360 --> 00:02:09,930 so I want to enter ipconfig /all. 54 00:02:09,930 --> 00:02:12,510 Then I'll be able to see all these additional details 55 00:02:12,510 --> 00:02:15,060 about my TCP/IP configuration. 56 00:02:15,060 --> 00:02:18,630 Now here I can see my host name, MSEDGEWIN10, 57 00:02:18,630 --> 00:02:19,680 I can also see a description 58 00:02:19,680 --> 00:02:21,210 of the model of the network adapter, 59 00:02:21,210 --> 00:02:23,430 or the network interface part I have installed. 60 00:02:23,430 --> 00:02:24,690 I can see the physical address 61 00:02:24,690 --> 00:02:27,360 and the fact that DHCP is enabled on this machine, 62 00:02:27,360 --> 00:02:29,370 as well as the autoconfiguration being enabled 63 00:02:29,370 --> 00:02:31,800 if DHCP fails to get an IP address, 64 00:02:31,800 --> 00:02:34,260 which means I can have an APIPA address assigned 65 00:02:34,260 --> 00:02:35,160 if I need to. 66 00:02:35,160 --> 00:02:37,470 I can also see the IP address and subnet mask 67 00:02:37,470 --> 00:02:39,990 just like I did in the summarized ipconfig version, 68 00:02:39,990 --> 00:02:41,760 but now I also see my lease times 69 00:02:41,760 --> 00:02:44,730 of the issue and expiration for that DHCP address. 70 00:02:44,730 --> 00:02:46,620 I also see my default gateway, 71 00:02:46,620 --> 00:02:49,950 my DHCP server and DNS servers IP addresses. 72 00:02:49,950 --> 00:02:51,570 That is a lot of information 73 00:02:51,570 --> 00:02:54,000 and it can be really helpful to you as a network technician 74 00:02:54,000 --> 00:02:55,860 during your troubleshooting efforts. 75 00:02:55,860 --> 00:02:57,780 Next, we have ifconfig. 76 00:02:57,780 --> 00:03:00,600 Now ifconfig stands for interface configuration, 77 00:03:00,600 --> 00:03:03,030 and it's the command line tool used in Unix, Linux, 78 00:03:03,030 --> 00:03:06,270 and OS X systems to display IP address information 79 00:03:06,270 --> 00:03:08,880 just like we did with ipconfig in Windows. 80 00:03:08,880 --> 00:03:10,770 ipconfig only works in Windows, 81 00:03:10,770 --> 00:03:11,730 so if you're going to be working 82 00:03:11,730 --> 00:03:15,840 on a Unix, Linux, or OSX system, you have to use ifconfig. 83 00:03:15,840 --> 00:03:18,720 Now, ifconfig is used to configure your network interfaces 84 00:03:18,720 --> 00:03:20,910 and troubleshoot network connectivity issues. 85 00:03:20,910 --> 00:03:22,920 If you enter the command ifconfig by itself 86 00:03:22,920 --> 00:03:24,810 and you press enter, the system is going to display 87 00:03:24,810 --> 00:03:27,300 the status of the currently active interfaces. 88 00:03:27,300 --> 00:03:30,630 If you only want to see a single interface though, like en0, 89 00:03:30,630 --> 00:03:33,330 you can enter ifconfig en0. 90 00:03:33,330 --> 00:03:34,260 Now, if you want to display 91 00:03:34,260 --> 00:03:36,270 all the interfaces available on a system, 92 00:03:36,270 --> 00:03:38,430 even if those interfaces are currently down, 93 00:03:38,430 --> 00:03:40,830 you would enter ifconfig -a, 94 00:03:40,830 --> 00:03:42,300 which is like the slash all command 95 00:03:42,300 --> 00:03:44,130 that we used inside of Windows. 96 00:03:44,130 --> 00:03:47,820 Now, the big difference here between ifconfig and ipconfig 97 00:03:47,820 --> 00:03:48,653 is that you're going to get 98 00:03:48,653 --> 00:03:50,910 the same amount of information with ifconfig, 99 00:03:50,910 --> 00:03:53,010 regardless of whether you're using it by itself, 100 00:03:53,010 --> 00:03:55,860 with an active interface, or with the dash-a option. 101 00:03:55,860 --> 00:03:58,530 There's no brief version of it, the only difference 102 00:03:58,530 --> 00:04:00,720 is the number of interfaces that are going to be returned, 103 00:04:00,720 --> 00:04:02,430 whether you're saying a single interface, 104 00:04:02,430 --> 00:04:05,130 the active interfaces, or all the interfaces. 105 00:04:05,130 --> 00:04:07,140 Notice here I typed in ifconfig, 106 00:04:07,140 --> 00:04:09,930 and under en0 you can see inet6, 107 00:04:09,930 --> 00:04:12,060 which lists out my IPv6 address. 108 00:04:12,060 --> 00:04:14,700 And I see inet, which is my IPv4 address, 109 00:04:14,700 --> 00:04:18,269 which is 192.168.1.54. 110 00:04:18,269 --> 00:04:20,550 All the other information I need is there too. 111 00:04:20,550 --> 00:04:22,260 This includes things like my physical address 112 00:04:22,260 --> 00:04:24,600 or Mac address, which is listed as ether, 113 00:04:24,600 --> 00:04:26,520 my net mask or subnet mask, 114 00:04:26,520 --> 00:04:28,320 which is shown in hexadecimal equivalent, 115 00:04:28,320 --> 00:04:32,310 but it's still going to be equivalent to 255.255.255.0 116 00:04:32,310 --> 00:04:33,330 like you're used to. 117 00:04:33,330 --> 00:04:35,430 It's going to have the broadcast IP for this network 118 00:04:35,430 --> 00:04:37,350 and the fact that this network is up. 119 00:04:37,350 --> 00:04:38,790 As you can see, by default, 120 00:04:38,790 --> 00:04:41,940 ifconfig has more details than ipconfig does 121 00:04:41,940 --> 00:04:43,410 on a Windows client. 122 00:04:43,410 --> 00:04:45,030 Now, if you need additional details, 123 00:04:45,030 --> 00:04:48,450 you can enter ifconfig dash-v and then the interface. 124 00:04:48,450 --> 00:04:50,490 The dash-v stands for verbose, 125 00:04:50,490 --> 00:04:52,530 meaning tell me a lot about this thing. 126 00:04:52,530 --> 00:04:54,810 So you can see here I get a lot more details 127 00:04:54,810 --> 00:04:56,130 including the type of the connection, 128 00:04:56,130 --> 00:04:57,690 in this case, it's wifi, 129 00:04:57,690 --> 00:05:00,330 the speed of the transmission for the uplinks and downlinks, 130 00:05:00,330 --> 00:05:02,220 and if the quality of service is enabled or not. 131 00:05:02,220 --> 00:05:05,700 ifconfig can also be used to control the network connection 132 00:05:05,700 --> 00:05:07,920 and not simply display information about it. 133 00:05:07,920 --> 00:05:10,470 If, for example, I want to turn off that connection, 134 00:05:10,470 --> 00:05:12,510 I can use ifconfig down, 135 00:05:12,510 --> 00:05:14,550 and this will shut down the network interface. 136 00:05:14,550 --> 00:05:16,110 If I use ifconfig up, 137 00:05:16,110 --> 00:05:18,150 this will activate that network interface. 138 00:05:18,150 --> 00:05:20,250 If you're using static assignments on an interface, 139 00:05:20,250 --> 00:05:22,260 you first need to shut down that interface 140 00:05:22,260 --> 00:05:24,537 and then set the new address and subnet mask, 141 00:05:24,537 --> 00:05:26,550 and then you can activate the interface again 142 00:05:26,550 --> 00:05:28,770 by using ifconfig up. 143 00:05:28,770 --> 00:05:30,570 Remember, ifconfig down 144 00:05:30,570 --> 00:05:32,400 turns off your network interface card, 145 00:05:32,400 --> 00:05:33,750 and if you enter ifconfig up, 146 00:05:33,750 --> 00:05:36,420 it'll turn that network interface card back on. 147 00:05:36,420 --> 00:05:38,040 These are really important to remember 148 00:05:38,040 --> 00:05:39,960 because if you're not seeing any network connectivity 149 00:05:39,960 --> 00:05:41,520 on a Linux client or server, 150 00:05:41,520 --> 00:05:43,590 it could be that somebody mistakenly turned off 151 00:05:43,590 --> 00:05:44,610 that network card 152 00:05:44,610 --> 00:05:48,270 and you just need to enter ifconfig up to turn it back on. 153 00:05:48,270 --> 00:05:49,920 Now, as of this recording, 154 00:05:49,920 --> 00:05:52,350 ifconfig is considered officially deprecated, 155 00:05:52,350 --> 00:05:53,610 which means it's now considered to be 156 00:05:53,610 --> 00:05:55,170 obsolete in modern systems, 157 00:05:55,170 --> 00:05:57,270 and network administrators should instead be using 158 00:05:57,270 --> 00:05:59,550 the ip command, which has replaced it. 159 00:05:59,550 --> 00:06:02,520 That said, many systems still support ifconfig, 160 00:06:02,520 --> 00:06:04,800 at least for now, so you should still learn it 161 00:06:04,800 --> 00:06:07,020 in case you're working on an older system. 162 00:06:07,020 --> 00:06:09,000 Now, finally, we have ip. 163 00:06:09,000 --> 00:06:11,580 The ip command is going to be used to assign an address 164 00:06:11,580 --> 00:06:12,690 to a network interface 165 00:06:12,690 --> 00:06:14,550 or configure a network interface parameter 166 00:06:14,550 --> 00:06:17,850 on a Unix, Linux, or OSX operating system. 167 00:06:17,850 --> 00:06:19,260 ip is a newer tool 168 00:06:19,260 --> 00:06:22,440 and it was designed as a modern replacement for ifconfig. 169 00:06:22,440 --> 00:06:25,020 The ip command stands for internet protocol 170 00:06:25,020 --> 00:06:27,900 and it supports all the same functions as the if command. 171 00:06:27,900 --> 00:06:30,630 The ip command though can do a whole lot more. 172 00:06:30,630 --> 00:06:33,210 Now the ip command is actually an entire suite of tools 173 00:06:33,210 --> 00:06:35,850 that supports not just configuring your interface address, 174 00:06:35,850 --> 00:06:38,040 but also things like routing, creating tunnels, 175 00:06:38,040 --> 00:06:40,530 and much, much more that is way beyond the scope 176 00:06:40,530 --> 00:06:43,170 of this particular course and this exam. 177 00:06:43,170 --> 00:06:44,640 Now, instead, I want to focus 178 00:06:44,640 --> 00:06:47,760 on how we can replace the if command using what we learned 179 00:06:47,760 --> 00:06:51,000 with similar features inside of the ip command suite. 180 00:06:51,000 --> 00:06:52,440 Now first, if I want to display 181 00:06:52,440 --> 00:06:54,270 the configuration of my interfaces, 182 00:06:54,270 --> 00:06:58,860 I can simply enter ip space a instead of using ifconfig, 183 00:06:58,860 --> 00:07:01,110 and this is going to gimme the same type of information. 184 00:07:01,110 --> 00:07:04,770 The ip space a stands for ip space address 185 00:07:04,770 --> 00:07:06,990 inside of the ip suite of tools. 186 00:07:06,990 --> 00:07:08,490 Second, if I need to assign 187 00:07:08,490 --> 00:07:10,290 a static IP address to an interface, 188 00:07:10,290 --> 00:07:15,290 I can use ip space a space add the IP address space dev 189 00:07:15,480 --> 00:07:17,340 space whatever device I'm using. 190 00:07:17,340 --> 00:07:19,440 For example, this will set the IP address 191 00:07:19,440 --> 00:07:23,280 to the device interface known as eth0 or ethernet zero, 192 00:07:23,280 --> 00:07:27,240 as 192.168.1.123. 193 00:07:27,240 --> 00:07:29,430 Third, we can remove that static ip address 194 00:07:29,430 --> 00:07:33,690 by entering ip space a space del space ip address 195 00:07:33,690 --> 00:07:35,700 space dev space device, 196 00:07:35,700 --> 00:07:38,160 and that will be able to take out that ip address 197 00:07:38,160 --> 00:07:39,570 from that device. 198 00:07:39,570 --> 00:07:41,880 Now fourth, if we want to change our Mac address, 199 00:07:41,880 --> 00:07:44,610 we can conduct Mac spoofing simply by entering 200 00:07:44,610 --> 00:07:49,290 ip space link space set space dev space the device, 201 00:07:49,290 --> 00:07:52,325 in this case eth0, space address space, 202 00:07:52,325 --> 00:07:54,030 and the Mac address you want to use, 203 00:07:54,030 --> 00:07:59,030 in this case 00:11:22:33:44:55 204 00:07:59,040 --> 00:08:01,230 or whatever other Mac address you want to use. 205 00:08:01,230 --> 00:08:03,630 Fifth, if you want to make your network interface card 206 00:08:03,630 --> 00:08:05,310 operate in promiscuous mode, 207 00:08:05,310 --> 00:08:07,830 this will allow it to listen to all the traffic on a network 208 00:08:07,830 --> 00:08:10,710 and not just the traffic destined for its own Mac address. 209 00:08:10,710 --> 00:08:15,710 To do this, you can enter ip space link space set space dev 210 00:08:15,750 --> 00:08:18,360 space your device, eth0 in this case, 211 00:08:18,360 --> 00:08:20,970 space promisc space on. 212 00:08:20,970 --> 00:08:23,580 This is really useful if you're setting up a packet sniffer 213 00:08:23,580 --> 00:08:27,000 or a packet capture on a Linux client or a server. 214 00:08:27,000 --> 00:08:28,530 Finally, if you need to disable 215 00:08:28,530 --> 00:08:30,120 or enable a network interface, 216 00:08:30,120 --> 00:08:35,120 you can use ip space link space set space eth0 space down 217 00:08:35,760 --> 00:08:37,620 to turn off eth0, 218 00:08:37,620 --> 00:08:42,620 or ip link set eth0 up to turn it back on. 219 00:08:42,750 --> 00:08:44,580 Now we really only just scratched the surface 220 00:08:44,580 --> 00:08:46,230 of what the ip command can do, 221 00:08:46,230 --> 00:08:48,480 but if you're working heavily with Linux systems, 222 00:08:48,480 --> 00:08:50,010 I recommend you spend a little time 223 00:08:50,010 --> 00:08:51,720 learning more about the ip command 224 00:08:51,720 --> 00:08:53,730 and all the different functions it has. 225 00:08:53,730 --> 00:08:55,500 For this certification exam, though, 226 00:08:55,500 --> 00:08:57,570 we covered exactly what you need to know 227 00:08:57,570 --> 00:08:59,720 to make sure you're successful on test day.