本文共 5322 字,大约阅读时间需要 17 分钟。
对于我们这些学生来说,如果是自学的朋友来说,想摸到真机那实在是太难了,说去买一台呢?买来又没有多大作用,利用dynamips来模拟呢,他本来就是加载的IOS,在flash里面又没有IOS,这时候那对于我们自学的朋友怎么办呢?大家可以使用Cisco Packet Tracert来做这个实验,那么下面我就带领着大家一起来把这个实验做做。
拓扑图如下:
现在我们将路由器端配置好:
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int fa0/0 Router(config-if)#ip add 192.168.1.1 255.255.255.0 Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up Router(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upend Router# |
在路由器上面暂时就只需要配置一个IP地址就行了。
在TFTP Server端的配置如下:
这里将TFTP Server端的IP地址配置在与路由器同一个网段中。
开启TFTP Service功能。在这里我们可以看见有很多种的ios文件。
现在测试一下我们的TFTP Server与路由器是否能够正常通信。
从上面结果来看我们的TFTP Server能够正常下我们的路同器进行通信。
好了现在我们开始来升级我们的IOS:
Router>en Router#dir 先查看一下我们当前flash里面的IOS文件,这里我们可以看出来我们当前的IOS文件是 Directory of flash:/3 -rw- 50938004 <no date> c2800nm-advipservicesk9-mz.124-15.T1.bin 2 -rw- 28282 <no date> sigdef-category.xml 1 -rw- 227537 <no date> sigdef-default.xml64016384 bytes total (12822561 bytes free) 这里我们可以看出当前总共用了多少空间,总共有 Router#copy tftp: flash: 这句就是将TFTP里面的IOS复制到FLASH里面。 Address or name of remote host []? 192.168.1.2 TFTP Server端的IP地址 Source filename []? c2800nm-ipbasek9-mz.124-8.bin TFTP Server上面的IOS文件名 Destination filename [c2800nm-ipbasek9-mz.124-8.bin]? 传到路由器FLASH里面的IOS文件名 Accessing tftp://192.168.1.2/c2800nm-ipbasek9-mz.124-8.bin... Loading c2800nm-ipbasek9-mz.124-8.bin from 192.168.1.2: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 15522644 bytes] 这里!表示正在传送。15522644 bytes copied in 8.516 secs (309739 bytes/sec) 这里是我们IOS总共有多大,从这里我们可以看出来,我们的IOS大于了我们的FLASH空间,所以会提示空间不足。 %Error copying tftp://192.168.1.2/c2800nm-ipbasek9-mz.124-8.bin (Not enough space on device) 这里提示我们出错了,原因是空间不足,所以我们在传IOS的时候我们还是要先看看FLASH时面当前剩余的空间有多大。Router#dir Directory of flash:/3 -rw- 50938004 <no date> c2800nm-advipservicesk9-mz.124-15.T1.bin 2 -rw- 28282 <no date> sigdef-category.xml 1 -rw- 227537 <no date> sigdef-default.xml64016384 bytes total (12822561 bytes free) Router#当我们上传成功以后呢?这里面就应该显示我们刚才所上传的那个IOS文件名了。 那么我们再来看看,如何将路由器里面的IOS下载到我们的TFTP Server上面去呢? Router#copy flash: tftp: 这条命令就是将flash里面的IOS复制到tftp上面去 Source filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin flash上面的IOS文件名 Address or name of remote host []? 192.168.1.2 TFTP Server的IP地址 Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]? 保存在TFTP Server端的文件名 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 50938004 bytes]50938004 bytes copied in 28.046 secs (1816000 bytes/sec) Router#以上就是我们将ios升级到路由器上,将路由器上的IOS备份到PC上。要做上在的那个实验可以用下面的方法来实现。 Router#delete flash: 删除flash里面的文件 Delete filename []?c2800nm-advipservicesk9-mz.124-15.T1.bin 删除IOS文件 Delete flash:/c2800nm-advipservicesk9-mz.124-15.T1.bin? [confirm] 提示我们是否真的要删除,如果是按回车Router#dir 我们现在查看一下flash里面到低还有没有我们的IOS文件了呢?没有了吧! Directory of flash:/2 -rw- 28282 <no date> sigdef-category.xml 1 -rw- 227537 <no date> sigdef-default.xml64016384 bytes total (63760565 bytes free) Router#copy tftp: flash: 将TFTP服务器上面的IOS升级到路由器上面 Address or name of remote host []? 192.168.1.2 TFTP服务器的IP地址 Source filename []? c2800nm-ipbasek9-mz.124-8.bin TFTP上面的IOS文件名 Destination filename [c2800nm-ipbasek9-mz.124-8.bin]? 传到路由器上面的IOS文件名 Accessing tftp://192.168.1.2/c2800nm-ipbasek9-mz.124-8.bin... Loading c2800nm-ipbasek9-mz.124-8.bin from 192.168.1.2: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 15522644 bytes]15522644 bytes copied in 8.906 secs (296175 bytes/sec) Router#dir 上传成功以后我们再来查看一下看看我们的IOS上传成功没有。 Directory of flash:/4 -rw- 15522644 <no date> c2800nm-ipbasek9-mz.124-8.bin 2 -rw- 28282 <no date> sigdef-category.xml 1 -rw- 227537 <no date> sigdef-default.xml64016384 bytes total (48237921 bytes free) Router#看看我们的C2800nm-ipbasek9-mz.124-8.bin是不是上传成功了呢? |
好了到此我们的这个通过TFTP 来升级与备份IOS是不是就成功了。还是很简单吧
本文转自 ltyluck 51CTO博客,原文链接:http://blog.51cto.com/ltyluck/209278
!
转载地址:http://flpzl.baihongyu.com/