Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use a while loop to indefinitely perform the following.. Prompt the user for port# Prompt the user for device _ type Connect to a device

Use a while loop to indefinitely perform the following..
Prompt the user for port#
Prompt the user for device_type
Connect to a device and print the prompt
Use a try block to handle timeout and authentication exceptions, should also have a catch all exception for any unexpected exception.
Exception should print the type of exception that occurred.
device login script
'''
devicelogin.py
a basic program to create an initial login to a cisco device
'''
from netmiko import ConnectHandler
device ={
'device_type': 'vyos',
'ip': '128.177.0.130',
'port':'2201',
'username': 'itsc1342',
'password': '1342itsc',
}
#create SSH socket to connect to device using the data in the library 'cisco'
net_connect = ConnectHandler(**device)
prompt=net_connect.find_prompt()
print(prompt)
Device Name Port Vendor Device_Type Type Model Username Password Inside IP Address
DLLS-COR12201 VYOS vyos Router itsc13421342itsc 172.16.10.3
DLLS-COR22202 VYOS vyos Router itsc13421342itsc 172.16.10.4
DLLS-DIS12203 VYOS vyos Router itsc13421342itsc 172.16.1.2
DLLS-DIS22204 VYOS vyos Router itsc13421342itsc 172.16.1.14
DLLS-ACC12205 Extreme Networks extreme_exos L3 Switch 8284XSQ itsc13421342itsc 172.16.101.1
DLLS-ACC22206 Extreme Networks extreme_exos L3 Switch 8284XSQ itsc13421342itsc 172.16.102.1
DLLS-ACC32207 Extreme Networks extreme_exos L3 Switch 8284XSQ itsc13421342itsc 172.16.103.1
FTW-COR12208 MikroTik mikrotik_routeros Router itsc1342+t10000h 1342itsc 172.16.10.5
FTW-COR22209 MikroTik mikrotik_routeros Router itsc1342+t10000h 1342itsc 172.16.10.6
FTW-DIS12210 MikroTik mikrotik_routeros Router itsc1342+t10000h 1342itsc 172.16.11.2
FTW-DIS22211 MikroTik mikrotik_routeros Router itsc1342+t10000h 1342itsc 172.16.11.14
FTW-ACC12212 Extreme Networks extreme_exos L3 Switch 8284XSQ itsc13421342itsc 172.16.111.1
FTW-ACC22213 Extreme Networks extreme_exos L3 Switch 8284XSQ itsc13421342itsc 172.16.112.1
FTW-ACC32214 Extreme Networks extreme_exos L3 Switch 8284XSQ itsc13421342itsc 172.16.113.1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

What is Ramayana, who is its creator, why was Ramayana written?

Answered: 1 week ago

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago