Configuring Multiple Routers Using SSH
Configuring Multiple Routers Using SSH
In this lab, we will be using the library Netmiko, developed by Kirk Byers which is an open-source multivendor library
that is used for SSH connections to network devices. Multi-vendor library means Netmiko supports network devices
from different vendors such as Cisco, Juniper, HP, etc.
- Go to your eve-ng and add 3 vIOS Routers, connect the router with Cloud 1 to establish the connectivity
between the router and the Windows machine.
- Boot the router and provide IP to the management interface using DHCP.
enable
configure terminal
interface gig 0/0
ip address dhcp
no shutdown
exit
ip domain-name abc.com
cryptokey generate rsa general-keys modulus 1024
ip ssh ver 2
username admin privilege 15 password cisco
line vty 0 4
login local
transport input all
exit
- Verify the reachability by pinging the IP address of router from local device.
- Go to the terminal of your device using VS code or using cmd and run the following command to begin the
installation of the library Netmiko:
Step 3: Time to begin the script for creating the loopback interface on Router.
- Import the library into your code. Getpass is used to collect the information in hidden manner.
- Create a for loop which can loop through the data of list devices and can connect to the routers of list one by
one like shown below. All of the remaining commands will be a part of this for loop.