有了IOS-Command-toolkit(COSI项目)省了不少事情,这里有n多个小工具,很实用的。
$先说说build-ip-routes.txt。
有的时候,设备很少,想模拟一个很大的网络常常需要手动输入很麻烦。实用build-ip-routes.txt可以自行模拟出这样一种场景。
参数,build-ip-routes.txt <路由条数> <网关>
[root@localhost /]# perl build-ip-routes.txt 50 10.0.0.0 ip route 7.201.200.192 255.255.255.192 10.0.0.0243 ip route 160.64.16.224 255.255.255.224 10.0.0.0197 ip route 37.113.130.192 255.255.255.192 10.0.0.0239 ip route 118.240.40.128 255.255.255.128 10.0.0.053 ip route 219.138.155.224 255.255.255.224 10.0.0.0144 ip route 67.231.115.224 255.255.255.224 10.0.0.0187 ip route 10.128.179.128 255.255.255.128 10.0.0.057 ip route 48.184.151.224 255.255.255.224 10.0.0.0148 ip route 73.121.22.224 255.255.255.224 10.0.0.016 ip route 22.224.13.192 255.255.255.192 10.0.0.0250 ip route 95.224.225.224 255.255.255.224 10.0.0.0189 ip route 41.119.101.224 255.255.255.224 10.0.0.0104 ip route 66.66.221.224 255.255.255.224 10.0.0.0110 ip route 127.113.252.0 255.255.252.0 10.0.0.095 ip route 205.36.252.0 255.255.252.0 10.0.0.08 ip route 111.36.178.224 255.255.255.224 10.0.0.0136 ip route 59.232.26.224 255.255.255.224 10.0.0.0159 ip route 201.209.189.192 255.255.255.192 10.0.0.0237 ip route 147.183.8.192 255.255.255.192 10.0.0.0227 ip route 164.53.113.192 255.255.255.192 10.0.0.029 ip route 36.69.175.192 255.255.255.192 10.0.0.032 ip route 111.156.45.128 255.255.255.128 10.0.0.05 ip route 135.226.218.224 255.255.255.224 10.0.0.0154 ip route 88.39.181.224 255.255.255.224 10.0.0.0144 ip route 113.172.24.192 255.255.255.192 10.0.0.0224 ip route 70.155.84.128 255.255.255.128 10.0.0.04 ip route 191.193.159.224 255.255.255.224 10.0.0.0151 ip route 93.249.107.0 255.255.255.0 10.0.0.060 ip route 28.119.77.224 255.255.255.224 10.0.0.0136 ip route 213.103.242.224 255.255.255.224 10.0.0.0112 ip route 116.27.62.224 255.255.255.224 10.0.0.0172 ip route 67.61.23.224 255.255.255.224 10.0.0.0196 ip route 137.104.11.224 255.255.255.224 10.0.0.00 ip route 112.53.207.224 255.255.255.224 10.0.0.0192 ip route 27.131.28.224 255.255.255.224 10.0.0.0110 ip route 33.154.252.0 255.255.252.0 10.0.0.080 ip route 29.133.205.0 255.255.255.0 10.0.0.065 ip route 165.25.47.192 255.255.255.192 10.0.0.0228 ip route 103.224.229.224 255.255.255.224 10.0.0.0137 ip route 159.52.81.128 255.255.255.128 10.0.0.040 ip route 34.46.221.128 255.255.255.128 10.0.0.059 ip route 51.83.95.192 255.255.255.192 10.0.0.0202 ip route 39.36.51.224 255.255.255.224 10.0.0.0136 ip route 35.34.200.224 255.255.255.224 10.0.0.0199 ip route 39.65.122.192 255.255.255.192 10.0.0.0243 ip route 148.238.187.224 255.255.255.224 10.0.0.0149 ip route 70.154.185.224 255.255.255.224 10.0.0.018 ip route 169.181.200.192 255.255.255.192 10.0.0.0217 ip route 134.39.186.224 255.255.255.224 10.0.0.0182 ip route 29.205.182.128 255.255.255.128 10.0.0.051 |
$有时候,监视路由器接口,你可能会出去一会,那怎么办啊。
交给show-interface.txt来做这件事情吧。
[root@localhost /]# expect show-interface.txt
show-interface hostname password enablepassword wait repeat interfacetype number
上面是语法,show-interface.txt ip 密码 enble密码 等待时间 重复次数 接口编号
以上的等待时间的单位是秒。
例:
[root@localhost /]# expect show-interface.txt 192.168.0.254 cisco ccie 10 2 ethernet 0 Sun Dec 11 00:04:04 CST 2005 192.168.0.254 show interface ethernet 0 Ethernet0 is up, line protocol is up Hardware is QUICC Ethernet, address is 0060.474f.b99a (bia 0060.474f.b99a) Internet address is 192.168.0.254/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:00, output hang never Last clearing of "show interface" counters never Queueing strategy: fifo Output queue 0/40, 0 drops; input queue 1/75, 0 drops 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 44551 packets input, 3189253 bytes, 0 no buffer Received 11671 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 input packets with dribble condition detected 89877 packets output, 7682145 bytes, 0 underruns(0/0/0) 856 output errors, 0 collisions, 3 interface resets 0 babbles, 0 late collision, 6 deferred 856 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out 16r1# Sun Dec 11 00:04:15 CST 2005 192.168.0.254 show interface ethernet 0 Ethernet0 is up, line protocol is up Hardware is QUICC Ethernet, address is 0060.474f.b99a (bia 0060.474f.b99a) Internet address is 192.168.0.254/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:00, output hang never Last clearing of "show interface" counters never Queueing strategy: fifo Output queue 0/40, 0 drops; input queue 1/75, 0 drops 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 44582 packets input, 3191135 bytes, 0 no buffer Received 11671 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 input packets with dribble condition detected 89909 packets output, 7685226 bytes, 0 underruns(0/0/0) 856 output errors, 0 collisions, 3 interface resets 0 babbles, 0 late collision, 6 deferred 856 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out |
| 共2页: 1 [2] 下一页 | ||
|
|
|||
| · 51CTO主编推荐经典专题 · RAID——磁盘阵列基础 · 充电计划之热门IT认证.. · 51CTO技术自测 挑战自.. · CISSP认证成长之路 · AMD Phenom三核处理器.. · 国际文档格式标准开战 · 2007年互联网大会 |
· 我是黑客我怕谁——讲.. · ARP攻击防范与解决方案 · Solaris 10 配置管理 · Solaris基础知识入门 · RIP路由协议专栏 · MPLS路由协议专栏 · OSPF路由协议专栏 · 思科路由器产品 |
||
|
|||
| · Java基础教程 · VPN技术 · ARP攻击防范与解决方案 · SQL Server 2005全解 · SOA 面向服务架构 · SQL Server 2005全解 · Java编程开发手册 · RAID——磁盘阵列基础 |
· 三层交换技术专题 · SQL Server入门到精通 · Windows Server 2003企.. · Windows远程桌面应用 · C#技术开发指南 · VPN技术 · Solaris 10 配置管理 · C#技术开发指南 |
||
|
|||
| · ARP攻击防范与解决方案 · VPN技术 · SQL Server 2005全解 · Java基础教程 · SQL Server入门到精通 · SQL Server 2005全解 · SOA 面向服务架构 · Java编程开发手册 |
· C#技术开发指南 · 三层交换技术专题 · C#技术开发指南 · Windows远程桌面应用 · RAID——磁盘阵列基础 · Windows Server 2003企.. · 邮件服务器专题 · wimax技术与趋势 |
||
| ·DB2 Viper快速入门 ·DB2 9数据库的镜像分割与.. |
·将XML应用程序从DB2 8.x.. ·DB2 9中的pureXML:如何.. |
| ·服务器中的“傻瓜机”在.. ·盖茨也喜欢登录Youtube看.. |
· · |
| ·拯救系统管理员 ·美国选民:我为什么选布什 |
·VMware公司中文命名挑战赛 ·我们真缺乏创新吗? |
| ·J0ker的CISSP之路:复习-.. ·J0ker的CISSP之路:复习-I.. |
·9月第3周安全回顾 内网安.. ·教你几招识别和防御Web网.. |
| · NGN:下一代网络 · 网络访问中断大排查 · FTTx光纤接入 |
· 教你使用Anti ARP Sniff.. · 网络嗅探教程:使用Snif.. · 常见病毒手工清除方法大.. |
| · C++是垃圾语言?! · 2007年IT界七大抄袭事件 · Java实用开发全集 |
· 解析Ajax开发框架 走进A.. · 基于Google Maps与Ajax.. · 基于Google Maps与Ajax.. |
| · 热门 IT 培训认证官方资.. · Ubuntu 中文开源频道 · Solaris基础知识入门 |
· 费力不讨好 数据中心主.. · AMD Phenom三核处理器解.. · 51CTO主编推荐经典专题 |
| · 甲骨文Oracle 11g正式发.. · Oracle数据库开发之PL/S.. · Oracle数据库开发基础教.. |
· 存储2006,一个并购的大.. · IDC宣布浪潮蝉联存储市.. · 双机热备技术 |