1 00:00:01,020 --> 00:00:07,940 In the previous video, we have created a simple python script for network automation on cisco router 2 00:00:08,320 --> 00:00:13,680 If you not sure that you understand what we have covered in the previous video, 3 00:00:13,720 --> 00:00:20,500 I recommend you to back to that video and play it again. But if you sure that you understand 4 00:00:20,500 --> 00:00:26,580 that topic, you can continue to this video. In this video, we are going to learn how to 5 00:00:26,580 --> 00:00:29,660 doing network automation on mikrotik router. 6 00:00:30,120 --> 00:00:38,280 This is the code that we will use in this video. I will also show you the code from the previous video 7 00:00:42,960 --> 00:00:46,400 Here we can see that we don’t have many different. 8 00:00:46,940 --> 00:00:53,720 In the cisco code, we need to import time, I already explained about time in the previous video 9 00:00:53,720 --> 00:00:58,180 But now, for mikrotik code, we don’t need to import time 10 00:00:59,400 --> 00:01:06,240 Here we define the ip address, username, and password of the mikrotik router. We call SSH 11 00:01:06,240 --> 00:01:12,260 Client function from paramiko and then we connect to the mikrotik router using the ip 12 00:01:12,260 --> 00:01:19,380 address, username, and password that we have defined before. 13 00:01:21,560 --> 00:01:27,500 The different between this two script is, that we need to invoke shell in the cisco router 14 00:01:27,860 --> 00:01:34,180 but we don’t in the mikrotik router. Also the keyword to send the command to the 15 00:01:34,180 --> 00:01:41,640 cisco router is send, but in mikrotik we use exec_command. And we don’t need to delay 16 00:01:41,640 --> 00:01:48,040 the program in mikrotik, but in cisco, we must sleep the program or the command will 17 00:01:48,040 --> 00:01:50,640 not send to the router successfully. 18 00:01:51,040 --> 00:01:54,660 Don’t forget to always close the ssh session. 19 00:01:54,660 --> 00:02:06,880 Save the code, open a command prompt, see that we are in the right directory 20 00:02:07,440 --> 00:02:13,260 Here we can see that we have script2.py. Let’s run the code. 21 00:02:20,760 --> 00:02:29,760 Okay, we have successfully run the code, In this example code, we will create a bridge interface in mikrotik 22 00:02:30,660 --> 00:02:36,400 and configure the ip address 10.2.2.1 to that bridge interface. 23 00:02:37,480 --> 00:02:42,360 Let’s go to mikrotik terminal and see if the script is work. 24 00:02:48,800 --> 00:02:54,480 You can see that now we have bridge interface and new ip address in the mikrotik 25 00:02:54,480 --> 00:03:02,920 Okay, now we are able to doing Network Automation on Cisco & Mikrotik routers, In the next video, 26 00:03:02,920 --> 00:03:08,980 we will learn how to doing Network Automation on Cisco & Mikrotik routers in one code. 27 00:03:08,980 --> 00:03:12,420 Thankyou for watching, and see you on the next video!