In the previous video, we already learn the basic of paramiko. 2
So now we are able to do a simple network automation using paramiko. 3
Next in this video, we are going to learn more about time sleep. 4
As I said in the previous video, that the function of time sleep is to stop the script for 1 second. 5
We need to stop the script for a second to wait the cisco command is executed correctly. 6
Now let’s try to remove the time sleep. 7
Let’s put hash here. Remember that hash means comment. So this script is not used anymore. 8
And then we will create loopback1, the ip address let’s say 10.1.1.2, save. 9
Now let’s run the script again, python paramiko_basic.py. 10
We will remote router 1, username cisco, and the password is also cisco. 11
Here we can see that the cisco command is not send correctly, we only get a hash here. 12
Let’s check in the router, here we can see configure from console by cisco. 13
So actually the python is already login to the router. But the command is not send correctly. 14
Let’s see the interface, do show ip interface brief, 15
here we can see that we don’t have loopback1 yet. 16
Now let’s put the time sleep again. 17
Run the script again, let’s clear this first, and then python paramiko_basic.py, 18
let’s remote router 1, username is cisco and the password is also cisco. 19
Here we can see that we are success login to 10.10.10.1, 20
which is router 1, and we also success to send the cisco command, 21
configure terminal, interface loopack1, and the ip address is 10.1.1.2, 22
Let’s check on router 1, do show ip interface brief, 23
here we can see that we have loopback1, and the ip address is 10.1.1.2, 24
Okay I hope you understand the function of time sleep, 25
I think enough for this video 26
Thank you for watching and see you on the next video.