1 00:00:00,360 --> 00:00:06,463 In the previous section, we already learn about network automation using paramiko. 2 00:00:06,925 --> 00:00:13,592 Next in this section, we are going to learn network automation using netmiko. 3 00:00:14,369 --> 00:00:15,849 What is netmiko? 4 00:00:16,592 --> 00:00:21,143 We will learn more about netmiko later in the next video. 5 00:00:22,068 --> 00:00:25,612 Now we are going to setup the topology first. 6 00:00:25,992 --> 00:00:34,286 Let’s just start, create new project, let’s say the name is network automation netmiko. 7 00:00:37,606 --> 00:00:50,074 Let’s import the ubuntu server, and then let’s also import some router, 8 00:00:50,454 --> 00:00:59,271 here we can type shift and then drag and drop the router, let’s import 5 router. 9 00:01:02,805 --> 00:01:17,402 Okay now we have 5 router, this is router 1, router 2, router 3, router 4, and this is router 5. 10 00:01:18,195 --> 00:01:21,913 Now let’s connecting all router to the switch. 11 00:01:26,819 --> 00:01:30,499 Let’s also connecting the switch to ubuntu server. 12 00:01:30,961 --> 00:01:38,195 Remember that in the ubuntu server, the interface that connected to gns3 is the second ethernet, 13 00:01:38,361 --> 00:01:40,298 so ethernet 1 here. 14 00:01:41,025 --> 00:01:48,809 Ethernet0 is connected to internet, ethernet1 is connected to gns3, and ethernet3 is connected 15 00:01:48,809 --> 00:01:50,361 to the laptop. 16 00:01:51,154 --> 00:02:01,702 If you forget, you can check it in the virtualbox, here click on ubuntu, and then setting. 17 00:02:05,220 --> 00:02:12,857 In the network section, here we can see that adapter 1 is nat, this is connected to internet, 18 00:02:13,204 --> 00:02:21,030 adapter2 is not attached, this is will be connected to gns3, and then adapter3 is host 19 00:02:21,030 --> 00:02:25,596 only adapter, this is connected to our laptop. 20 00:02:33,590 --> 00:02:41,460 Okay done, let’s start all router and ubuntu server, here we can click on this icon. 21 00:02:42,022 --> 00:02:47,110 Wait for a minute until all router and ubuntu server is started. 22 00:02:51,421 --> 00:02:58,934 While waiting for all router and ubuntu server started, let’s create a note for the ip address. 23 00:02:59,472 --> 00:03:10,392 Router 1, the ip address will be 10.10.10.1, router 2 will be 10.10.10.2, 24 00:03:14,125 --> 00:03:29,592 router 3 will be 10.10.10.3, router 4 will be 10.10.10.4, and last, router 5 will be 10.10.10.5 25 00:03:34,910 --> 00:03:48,850 Okay now let’s check on ubuntu server, login, let’s check the ip address. 26 00:03:51,592 --> 00:04:02,527 Here we can see that the ip address of enp0s3 is 10.0.2.15, this ip address is automatic, 27 00:04:02,924 --> 00:04:07,981 because we configure dhcp client on enp0s3 28 00:04:08,758 --> 00:04:20,857 For enp0s8, the ip address is 10.10.10.254, this is connected to gns3, and last, for enp0s9, 29 00:04:20,857 --> 00:04:29,851 the ip address is 192.168.56.2, this interface is connected to our laptop. 30 00:04:30,594 --> 00:04:34,932 So the ip address in the ubuntu server is correct. 31 00:04:35,775 --> 00:04:41,374 Now let’s configure ip address and ssh on all router. 32 00:04:42,216 --> 00:04:47,081 Let’s show the interface label first, click on this icon. 33 00:04:48,237 --> 00:04:54,676 Here we can see that all router connected to the switch on fa0/0. 34 00:04:55,601 --> 00:05:03,002 Later, the configuration of all router will be same, so we can write the template configuration 35 00:05:03,002 --> 00:05:04,337 on sublime. 36 00:05:04,552 --> 00:05:12,592 Let’s create new file, here we will write the template to configure ip address and ssh 37 00:05:12,592 --> 00:05:14,232 on all router, 38 00:05:14,893 --> 00:05:16,570 Configure terminal 39 00:05:18,502 --> 00:05:35,254 Interface fa0/0, no shutdown, and then ip address 10.10.10.1 255.255.255.0, 40 00:05:35,799 --> 00:05:38,832 this is will be for router 1. 41 00:05:39,261 --> 00:05:42,195 And then for ssh configuration 42 00:05:42,410 --> 00:05:53,681 Ip domain-name mydomain.local, crypto key generate rsa and then enter, 43 00:05:54,341 --> 00:05:58,438 Here for the modulus is 1024. 44 00:05:59,264 --> 00:06:02,877 Next, we need to create username and password. 45 00:06:03,274 --> 00:06:10,443 Username cisco privilege 15 secret cisco. 46 00:06:11,781 --> 00:06:18,352 Last, let’s configure vty, line vty 0 15. 47 00:06:18,550 --> 00:06:20,150 Login local. 48 00:06:20,976 --> 00:06:23,639 Don’t forget to save the configuration. 49 00:06:23,639 --> 00:06:24,685 Do write. 50 00:06:25,280 --> 00:06:32,368 Okay this is the configuration template to configure ip address and ssh on all router. 51 00:06:32,930 --> 00:06:40,385 Later for router 2, we just need to change the ip address, the other configuration is same. 52 00:06:40,938 --> 00:06:44,642 Let’s copy this, go to router 1. 53 00:06:47,532 --> 00:06:50,000 And then paste the command here. 54 00:06:55,995 --> 00:07:01,394 Okay all configuration is success, except in the modulus section. 55 00:07:01,584 --> 00:07:03,790 Let’s edit the template again, 56 00:07:04,352 --> 00:07:08,376 Here we have enter 2 time, let’s remove this. 57 00:07:08,954 --> 00:07:15,842 Let’s just copy in the crypto key section, back to router 1, paste, 58 00:07:16,354 --> 00:07:21,408 Here choose yes, and this is 1024. 59 00:07:23,192 --> 00:07:24,486 Okay done. 60 00:07:25,000 --> 00:07:27,424 Now we are done on router 1. 61 00:07:27,738 --> 00:07:31,950 Now let’s test to remote router 1 from ubuntu server. 62 00:07:32,479 --> 00:07:37,541 But before that, let’s remote ubuntu server from our laptop first. 63 00:07:38,053 --> 00:07:54,342 Ssh ubuntu@192.168.56.2, okay success, now let’s try ping to router 1, ping 10.10.10.1, 64 00:07:54,854 --> 00:07:56,928 okay this is success. 65 00:07:57,324 --> 00:08:06,164 Now let’s try to remote router 1, ssh cisco@10.10.10.1, 66 00:08:07,122 --> 00:08:15,420 Okay we get an error here, this is because yesterday we remote 10.10.10.1, 67 00:08:15,817 --> 00:08:22,729 but now we remote 10.10.10.1 again, but the router is different. 68 00:08:23,406 --> 00:08:35,176 To solve this, we can just remove this file, copy this, sudo rm and then paste it. 69 00:08:37,108 --> 00:08:45,287 Now let’s ssh to router 1 again, okay now this is success. 70 00:08:46,344 --> 00:08:54,428 Now Let’s try ping to router 2, this is failed, because we don’t configure anything yet 71 00:08:54,428 --> 00:08:55,948 on router 2. 72 00:08:56,542 --> 00:08:58,886 Now let’s configure router 2. 73 00:08:59,117 --> 00:09:03,957 In the sublime, let’s change the ip address become 2. 74 00:09:04,486 --> 00:09:09,843 Copy, back to gns3, open router 2. 75 00:09:15,194 --> 00:09:17,768 And then paste the command here. 76 00:09:18,627 --> 00:09:27,811 Here we can see configure terminal, configure the ip address, domain name, crypto key generate 77 00:09:27,811 --> 00:09:34,869 rsa 1024, create username, and configure vty. 78 00:09:35,530 --> 00:09:38,954 And last here we save the configuration. 79 00:09:39,565 --> 00:09:43,672 Okay so the configuration on router 2 is success. 80 00:09:44,102 --> 00:09:49,621 Let’s check it, ping to router 2 first, okay success. 81 00:09:49,869 --> 00:09:52,732 Let’s try ssh to router 2. 82 00:09:59,454 --> 00:10:02,118 Okay this is also success. 83 00:10:02,762 --> 00:10:10,487 Okay I think enough for this video, for router 3, 4 and 5, you can try it by your self. 84 00:10:10,867 --> 00:10:16,037 You just need to edit the ip address and then copy paste the command. 85 00:10:16,516 --> 00:10:22,689 In the next video, we are going to start learning network automation using netmiko. 86 00:10:23,251 --> 00:10:26,961 Thank you for watching and see you on the next video.