Question: Create a list, called port _ list, It shall include all ports between 2 2 0 5 - 2 2 1 4 . a .

Create a list, called port_list, It shall include all ports between 2205-2214.
a. Create a loop that iterates through each list element
i. Use the function len() to stop the loop
ii. Print "port", list position # and port number of each list item
Example..... Port 12205
Create a program that reads from a list of port numbers to login to network devices.
a. Create a list called port_list that contains ports 2205-2214
b. Create a for loop that uses the len() of port_list as stop point
i. Loop shall connect to each device in port_list.
c. Create s dictionary named cisco that contains
i. Device_type
ii. Ip
iii. Username
iv. Password
v. Port (from port_list[])
d. Connect to each device in port_list
Conditionals
a. If statements with the less than operator to overwrite the device type.
b. Use an if statement to prevent attempts at port 2205
i. Use the continue statement
Exception Handling
a. Import Netmiko authenticaton and timeout exceptions
i. Don't forget the general exception Clause
b. Use a try and exept block to catch exceptions so loop continues to operate
i. Use a print statement to notify user that an error has occurred.
Testing
a. Add a conditional that sets the password to 'CISCO' for port 22013
b. Add an invalid port to the list, somewhere before the last element.
 Create a list, called port_list, It shall include all ports between

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!