In the previous section, we already learn about network automation using paramiko. 2
Next in this section, we are going to learn network automation using netmiko. 3
What is netmiko? 4
We will learn more about netmiko later in the next video. 5
Now we are going to setup the topology first. 6
Let’s just start, create new project, let’s say the name is network automation netmiko. 7
Let’s import the ubuntu server, and then let’s also import some router, 8
here we can type shift and then drag and drop the router, let’s import 5 router. 9
Okay now we have 5 router, this is router 1, router 2, router 3, router 4, and this is router 5. 10
Now let’s connecting all router to the switch. 11
Let’s also connecting the switch to ubuntu server. 12
Remember that in the ubuntu server, the interface that connected to gns3 is the second ethernet, 13
so ethernet 1 here. 14
Ethernet0 is connected to internet, ethernet1 is connected to gns3, and ethernet3 is connected 15
to the laptop. 16
If you forget, you can check it in the virtualbox, here click on ubuntu, and then setting. 17
In the network section, here we can see that adapter 1 is nat, this is connected to internet, 18
adapter2 is not attached, this is will be connected to gns3, and then adapter3 is host 19
only adapter, this is connected to our laptop. 20
Okay done, let’s start all router and ubuntu server, here we can click on this icon. 21
Wait for a minute until all router and ubuntu server is started. 22
While waiting for all router and ubuntu server started, let’s create a note for the ip address. 23
Router 1, the ip address will be 10.10.10.1, router 2 will be 10.10.10.2, 24
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
Okay now let’s check on ubuntu server, login, let’s check the ip address. 26
Here we can see that the ip address of enp0s3 is 10.0.2.15, this ip address is automatic, 27
because we configure dhcp client on enp0s3 28
For enp0s8, the ip address is 10.10.10.254, this is connected to gns3, and last, for enp0s9, 29
the ip address is 192.168.56.2, this interface is connected to our laptop. 30
So the ip address in the ubuntu server is correct. 31
Now let’s configure ip address and ssh on all router. 32
Let’s show the interface label first, click on this icon. 33
Here we can see that all router connected to the switch on fa0/0. 34
Later, the configuration of all router will be same, so we can write the template configuration 35
on sublime. 36
Let’s create new file, here we will write the template to configure ip address and ssh 37
on all router, 38
Configure terminal 39
Interface fa0/0, no shutdown, and then ip address 10.10.10.1 255.255.255.0, 40
this is will be for router 1. 41
And then for ssh configuration 42
Ip domain-name mydomain.local, crypto key generate rsa and then enter, 43
Here for the modulus is 1024. 44
Next, we need to create username and password. 45
Username cisco privilege 15 secret cisco. 46
Last, let’s configure vty, line vty 0 15. 47
Login local. 48
Don’t forget to save the configuration. 49
Do write. 50
Okay this is the configuration template to configure ip address and ssh on all router. 51
Later for router 2, we just need to change the ip address, the other configuration is same. 52
Let’s copy this, go to router 1. 53
And then paste the command here. 54
Okay all configuration is success, except in the modulus section. 55
Let’s edit the template again, 56
Here we have enter 2 time, let’s remove this. 57
Let’s just copy in the crypto key section, back to router 1, paste, 58
Here choose yes, and this is 1024. 59
Okay done. 60
Now we are done on router 1. 61
Now let’s test to remote router 1 from ubuntu server. 62
But before that, let’s remote ubuntu server from our laptop first. 63
Ssh ubuntu@192.168.56.2, okay success, now let’s try ping to router 1, ping 10.10.10.1, 64
okay this is success. 65
Now let’s try to remote router 1, ssh cisco@10.10.10.1, 66
Okay we get an error here, this is because yesterday we remote 10.10.10.1, 67
but now we remote 10.10.10.1 again, but the router is different. 68
To solve this, we can just remove this file, copy this, sudo rm and then paste it. 69
Now let’s ssh to router 1 again, okay now this is success. 70
Now Let’s try ping to router 2, this is failed, because we don’t configure anything yet 71
on router 2. 72
Now let’s configure router 2. 73
In the sublime, let’s change the ip address become 2. 74
Copy, back to gns3, open router 2. 75
And then paste the command here. 76
Here we can see configure terminal, configure the ip address, domain name, crypto key generate 77
rsa 1024, create username, and configure vty. 78
And last here we save the configuration. 79
Okay so the configuration on router 2 is success. 80
Let’s check it, ping to router 2 first, okay success. 81
Let’s try ssh to router 2. 82
Okay this is also success. 83
Okay I think enough for this video, for router 3, 4 and 5, you can try it by your self. 84
You just need to edit the ip address and then copy paste the command. 85
In the next video, we are going to start learning network automation using netmiko. 86
Thank you for watching and see you on the next video.