1 00:00:00,598 --> 00:00:06,581 In the previous video, we already learn how to configure multiple router at once. 2 00:00:07,174 --> 00:00:17,012 Here we can see that we looping from 1 until 5. And then here we connect to 10.10.10.1 3 00:00:17,254 --> 00:00:21,990 until 10.10.10.5 using looping. 4 00:00:23,044 --> 00:00:27,381 Looping like this actually is not best practice. 5 00:00:28,219 --> 00:00:35,579 Now the ip address of all router is in sequence. But how if the ip address 6 00:00:35,579 --> 00:00:47,874 of all router is not in sequence, let’s say we have 1, and then 11, and then 20, 35, and others, 7 00:00:48,515 --> 00:00:54,000 Or, how if the ip address of all router is not similar like this? 8 00:00:55,044 --> 00:01:01,769 For now the first 3 number is same, which is 10.10.10, 9 00:01:02,546 --> 00:01:07,277 How if the ip address of all router is totally different? 10 00:01:07,839 --> 00:01:12,993 So we can not configure multiple router at once using this way. 11 00:01:13,704 --> 00:01:19,485 The solution is, we can save the ip address of all router in the list, 12 00:01:20,084 --> 00:01:23,375 and then we do looping on the list. 13 00:01:23,912 --> 00:01:38,645 Let’s just try, let’s just copy this, create new file, the name is paramiko_looping_list.py, 14 00:01:44,626 --> 00:01:46,692 And then paste the script. 15 00:01:48,010 --> 00:01:51,885 First we need to create the list of ip address, 16 00:01:52,404 --> 00:02:01,067 so here list_ip and then let’s put the ip address of router 1 until router 5 here. 17 00:02:01,746 --> 00:02:15,947 Let’s start with router 1, 10.10.10.1, 10.10.10.2 for router 2, 10.10.10.3 for router 3, 18 00:02:16,774 --> 00:02:25,633 10.10.10.4 for router 4, and last 10.10.10.5 for router 5. 19 00:02:26,602 --> 00:02:32,169 Here the script is to long, we can enter it after the comma, 20 00:02:32,534 --> 00:02:37,405 let’s say after 3 router, we can enter like this. 21 00:02:45,764 --> 00:02:48,302 Okay now the script is look good. 22 00:02:49,284 --> 00:02:56,205 now we have the list of ip address, next we can looping to this list. 23 00:02:57,174 --> 00:03:02,637 Let’s change this variable to ip, you are free to use anything here, 24 00:03:02,719 --> 00:03:05,381 because this is just a variable. 25 00:03:06,122 --> 00:03:10,838 And then let’s change this become the name of the list. 26 00:03:11,642 --> 00:03:19,252 Here for the connect, we don’t need f string anymore, we can just put the ip variable. 27 00:03:19,716 --> 00:03:28,981 Because the value of ip variable is 10.10.10.1, so we don’t need f string anymore. 28 00:03:29,722 --> 00:03:35,258 Here for the print, let’s also change this become ip variable. 29 00:03:36,720 --> 00:03:44,842 Okay and then here configure terminal, interface loopback 3, let’s change this become loopback4, 30 00:03:45,138 --> 00:03:52,323 and the ip address will be same on all router. Let’s say 10.5.1.1, 31 00:03:52,946 --> 00:04:01,738 so the ip address of loopback4 for all router will be same, which is 10.5.1.1 32 00:04:02,577 --> 00:04:09,794 We will learn how to configure different ip address for each router later in the next video. 33 00:04:10,564 --> 00:04:19,240 And then do write here to save the configuration, last here we send command to see the interface. 34 00:04:20,084 --> 00:04:24,938 Okay, save, let’s execute this script, 35 00:04:26,589 --> 00:04:41,491 Let’s login to ubuntu server using ssh, ssh ubuntu@192.168.56.2 ls, 36 00:04:41,814 --> 00:04:50,318 Let’s cd to lab_paramiko, ls again, here we can see that we have paramiko_looping_list.py, 37 00:04:50,829 --> 00:04:52,912 let’s execute this script, 38 00:04:56,824 --> 00:04:58,667 Just enter enter here, 39 00:05:01,764 --> 00:05:08,747 Okay success login to router 1, create loopback4, save the configuration, 40 00:05:08,824 --> 00:05:15,960 and here we can see that we have loopback4, the ip address is 10.5.1.1, 41 00:05:16,731 --> 00:05:26,507 Router 2 also success, we have loopback4, the ip address is same, which is 10.5.1.1 42 00:05:27,617 --> 00:05:42,000 Router 3 also success, router 4 also success, and last, router 5 also success. 43 00:05:43,752 --> 00:05:48,171 Okay so now we are success configure all router at once 44 00:05:48,171 --> 00:05:49,579 using list. 45 00:05:50,174 --> 00:05:52,556 I think enough for this video 46 00:05:52,816 --> 00:05:56,164 Thank you for watching and see you on the next video.