winway / commentRepo

commenyRepo
0 stars 0 forks source link

使用telnetlib与网络设备交互 | winway's blog #31

Open winway opened 2 years ago

winway commented 2 years ago

https://winway.github.io/2013/05/22/python-telnetlib-operate-network-device/

需求:自动登录到交换机或路由器,抓取acl规则命中统计信息。 Python可以使用telnetlib来方便的完成与网络设备的telnet交互,先看个简单的demo。12345678910111213141516171819import sysimport telnetlibHOST = "localhost"user = raw_input("Enter your remote account