##一.修改dynagen.ini配置文件
#1.注释掉原本telnet使用的putty
#telnet = start ../bin/putty/putty %h %p
#2.添加SecureCRT启动信息
telnet = start C:\SecureCRT\SecureCRT.exe /SCRIPT C:\Users\dell\Desktop\Dynamips@EDURainbow\bin\dynagen/crt_py.py /T /telnet %h %p
C:\SecureCRT\SecureCRT.exe ->>SecureCRT所在位置
C:\Users\dell\Desktop\Dynamips@EDURainbow\bin\dynagen/crt_py.py ->>python小脚本所在位置
/T ->>在同一个标签下打开
python脚本:crt_py.py
# $language = "Python"
# $interface = "1.0"
#Connected to Dynamips VM "R1" (ID 0, type c7200) - Console port
def main():
crt.Screen.Synchronous = True
if crt.Screen.WaitForString("Console port"):
crt.Screen.Send('\r')
prompt=crt.Screen.Get(1,0,2,80