0% found this document useful (0 votes)
10 views

Configuring Loopback Interface Using SSH

Uploaded by

thegaangster
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Configuring Loopback Interface Using SSH

Uploaded by

thegaangster
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

LAB: Configuring Loopback Interface 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.

Step 1: Setting up the network device for configuration.

- Go to your eve-ng and add a vIOS Router, 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

- Configure SSH on your router with the credentials: admin/cisco.

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.

Step 2: Installing the library NETMIKO.

- 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:

python -m pip install netmiko

Step 3: Time to begin the script for creating the loopback interface on Router.

- Import the library into your code.

- Create a dictionary for your device defining required parameters, here the device is Cisco virtual IOS.
- Call the ConnectHandler module to connect with the router. (** before the dictionary name is used to tell the
python to consider the content of the dictionary as key-value pairs instead of single elements.)

- Create a list that includes all the commands that we need to execute in the Global Configuration mode and call
them using send_config_set() to execute them on router.

- Send “show ip interface brief” to the router for verification. For sending commands into the Privileged mode we
use send_command().

- Save the changes permanently on router using save_config().

You might also like