This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import netmiko #帶入模組 | |
from netmiko import ConnectHandler #將Netmiko模組的ConnectHandler連線函式帶入 | |
def speed_change(param): #函式定義 | |
print("Please wait seconds. Connecting … \n") #作為等待過程 | |
my_device = { #利用Python字典對應的鍵與值代入路由器 | |
"host": "xxx.xxx.xxx.xxx", #輸入路由器的IP Address | |
"username": "xxx", #輸入使用者名稱 | |
"password": "xxx", #輸入密碼 | |
"device_type": "cisco_ios"} #輸入路由器的IOS type | |