Packet Tracer 5.3實驗(十六) 網路裝置系統升級

來源:互聯網
上載者:User

一、TFTP簡介
     TFTP(Trivial File Transfer Protocol,簡單檔案傳輸通訊協定)是TCP/IP協議族中的一個用來在客戶機與伺服器之間進行簡單檔案傳輸的協議,提供不複雜、開銷不大的檔案傳輸服務。TFTP承載在UDP上,使用69號連接埠。提供不可靠的資料流傳輸服務,不提供存取授權與認證機制,使用逾時重傳方式來保證資料的到達。與FTP相 比,TFTP的大小要小的多。

TFTP與FTP的區別
1、TFTP --簡單檔案傳輸通訊協定,udp,69;
2、FTP  --檔案傳輸通訊協定,tcp,20,21;
3、TFTP傳輸速度比FTP快,但是相對沒有FTP安全。

二、TFTP實驗環境
     一台裝有TFTP伺服器軟體的電腦,交換器(或者路由器)裝置,乙太網路線;

三、TFTP配置過程

  1. 配置主機、裝置ip地址;
  2. 使用copy命令;

四、下面將在模擬器中來看一下系統bin檔案的TFTP備份過程

1、拓撲圖

2、設定伺服器的IP地址192.168.1.2, 子網路遮罩255.255.255.0;

3、設定交換器的虛介面IP地址192.168.1.1, 子網路遮罩255.255.255.0;

Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int vlan 1
Switch(config-if)#ip add 192.168.1.1 255.255.255.0
Switch(config-if)#no shut

%LINK-5-CHANGED: Interface Vlan1, changed state to up

Switch(config-if)#

4、顯示交換器flash目錄;

Switch#dir
Directory of flash:/

    1  -rw-     3058048          <no date>  c2950-i6q4l2-mz.121-22.EA4.bin

64016384 bytes total (60958336 bytes free)
Switch#

說明:交換器裡有一個名為“c2950-i6q4l2-mz.121-22.EA4.bin”的檔案。

5、在升級前先備份該檔案;

Switch#copy flash: tftp:                                            //從flash中複製到tftp伺服器中Source filename []?c2950-i6q4l2-mz.121-22.EA4.bin                   //要複製的源檔案名稱Address or name of remote host []? 192.168.1.2                      //目標伺服器地址Destination filename [c2950-i6q4l2-mz.121-22.EA4.bin]? c2950.bin    //目標檔案名.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![OK - 3058048 bytes]3058048 bytes copied in 4.953 secs (617000 bytes/sec)

6、下面到TFTP伺服器上去看是否有了這個檔案?

進入伺服器,單擊配置,選擇TFTP,在右邊的檔案清單中可以看到c2950.bin。說明檔案已經寫入TFTP伺服器了。

7、現在要實現從TFTP伺服器上傳升級bin檔案;

1)首先在交換器上刪除c2950-i6q4l2-mz.121-22.EA4.bin這個檔案;

Switch#delete c2950-i6q4l2-mz.121-22.EA4.bin
Delete filename [c2950-i6q4l2-mz.121-22.EA4.bin]? //斷行符號
Delete flash:/c2950-i6q4l2-mz.121-22.EA4.bin? [confirm] //斷行符號

Switch#dir
Directory of flash:/

No files in directory

64016384 bytes total (64016384 bytes free)
Switch#

交換器flash的目錄中已經沒有檔案了。在此,先將bin檔案刪除了。請注意:在現實中如果空間足夠的話,不要刪除bin檔案。

8、從TFTP伺服器中下載升級檔案;

Switch#copy tftp: flash:                                               //從tftp伺服器到交換器flashAddress or name of remote host []? 192.168.1.2                         //源主機IP地址Source filename []? c2950.bin                                          //源檔案名稱Destination filename [c2950.bin]? c2950-i6q4l2-mz.121-22.EA4.bin       //目標檔案名稱Accessing tftp://192.168.1.2/c2950.bin....Loading c2950.bin from 192.168.1.2: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![OK - 3058048 bytes]3058048 bytes copied in 4.907 secs (623201 bytes/sec)

下載完成

9、使用dir顯示檔案

Switch#dirDirectory of flash:/    2  -rw-     3058048          <no date>  c2950-i6q4l2-mz.121-22.EA4.bin64016384 bytes total (60958336 bytes free)
Switch#

說明:檔案又下載到了交換器的flash中。

10、在完成系統升級後,要reload重啟系統;

Switch#
Switch#reload
Proceed with reload? [confirm] //斷行符號
C2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)Compiled Mon 22-Jul-02 18:57 by miwangCisco WS-C2950-24 (RC32300) processor (revision C0) with 21039K bytes of memory.2950-24 starting...Base ethernet MAC Address: 0030.A35C.4165Xmodem file system is available.Initializing Flash...flashfs[0]: 1 files, 0 directoriesflashfs[0]: 0 orphaned files, 0 orphaned directoriesflashfs[0]: Total bytes: 64016384flashfs[0]: Bytes used: 3058048flashfs[0]: Bytes available: 60958336flashfs[0]: flashfs fsck took 1 seconds....done Initializing Flash.Boot Sector Filesystem (bs:) installed, fsid: 3Parameter Block Filesystem (pb:) installed, fsid: 4Loading "flash:/c2950-i6q4l2-mz.121-22.EA4.bin"...########################################################################## [OK] Restricted Rights LegendUse, duplication, or disclosure by the Government issubject to restrictions as set forth in subparagraph(c) of the Commercial Computer Software - RestrictedRights clause at FAR sec. 52.227-19 and subparagraph(c) (1) (ii) of the Rights in Technical Data and ComputerSoftware clause at DFARS sec. 252.227-7013. cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706Cisco Internetwork Operating System SoftwareIOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA4, RELEASE SOFTWARE(fc1)Copyright (c) 1986-2005 by cisco Systems, Inc.Compiled Wed 18-May-05 22:31 by jharirbaCisco WS-C2950-24 (RC32300) processor (revision C0) with 21039K bytes of memory.Processor board ID FHK0610Z0WCRunning Standard Image24 FastEthernet/IEEE 802.3 interface(s)63488K bytes of flash-simulated non-volatile configuration memory.Base ethernet MAC Address: 0030.A35C.4165Motherboard assembly number: 73-5781-09 Power supply part number: 34-0965-01Motherboard serial number: FOC061004SZPower supply serial number: DAB0609127DModel revision number: C0Motherboard revision number: A0Model number: WS-C2950-24System serial number: FHK0610Z0WCCisco Internetwork Operating System SoftwareIOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA4, RELEASE SOFTWARE(fc1)Copyright (c) 1986-2005 by cisco Systems, Inc.Compiled Wed 18-May-05 22:31 by jharirbaPress RETURN to get started!%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch>enSwitch#show running-config Building configuration...Current configuration : 970 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Switch!ip name-server 0.0.0.0!!interface FastEthernet0/1!...!interface Vlan1 no ip address shutdown!!line con 0!line vty 0 4 loginline vty 5 15 login!!endSwitch#

此時系統將重裝bin檔案

11、重新顯示配置內容,會發現原來的設定都沒了。證明重傳成功了。

Switch>enSwitch#show running-config Building configuration...Current configuration : 970 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Switch!ip name-server 0.0.0.0!!interface FastEthernet0/1!...!interface Vlan1 no ip address shutdown!!line con 0!line vty 0 4 loginline vty 5 15 login!!endSwitch#

 

五、FTP方式備份與還原網路裝置系統

     FTP由於使用的是tcp可靠傳輸模式,速度沒有tftp快,但是有了使用者名稱和密碼,相對比tftp要安全些。

六、FTP實驗環境
     FTP伺服器、路由器、乙太網路線纜;

七、配置過程

1、設定管理員和路由器的ip地址;
2、在ftp伺服器中建立使用者名稱和密碼;
3、在路由器中指定與ftp伺服器中使用者名稱、密碼相關聯;
4、使用copy命令即可。

八、實驗步驟

實驗拓撲

1、設定FTP伺服器的IP地址192.168.1.2, 子網路遮罩255.255.255.0;

2、設定路由器Fa0/0的IP地址192.168.1.1, 子網路遮罩255.255.255.0;

Router>enRouter#conf tEnter configuration commands, one per line.  End with CNTL/Z.Router(config)#int fa0/0Router(config-if)#ip add 192.168.1.1 255.255.255.0Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouter(config-if)#exit

3、在FTP伺服器中建立使用者名稱和密碼;

4、在路由器中指定與ftp伺服器中使用者名稱、密碼相關聯;

Router(config)#ip ftp ?  password  Specify password for FTP connections  username  Specify username for FTP connectionsRouter(config)#ip ftp useRouter(config)#ip ftp username david ?  <cr>Router(config)#ip ftp username david Router(config)#ip ftp passRouter(config)#ip ftp password ?  <0-7>  Encryption type (0 to disable encryption, 7 for proprietary  LINE   LINE The passwordRouter(config)#ip ftp password 123456Router(config)#end

5、顯示路由器flash目錄;

Router#dirDirectory of flash:/    3  -rw-    33591768          <no date>  c1841-advipservicesk9-mz.124-15.T1.bin    2  -rw-       28282          <no date>  sigdef-category.xml    1  -rw-      227537          <no date>  sigdef-default.xml64016384 bytes total (30168797 bytes free)Router#cop

6、在升級前先備份該檔案;

Router#copy flRouter#copy flash: ?  ftp:            Copy to ftp: file system  running-config  Update (merge with) current system configuration  startup-config  Copy to startup configuration  tftp:           Copy to tftp: file systemRouter#copy flash: ftRouter#copy flash: ftp: Source filename []? c1841-advipservicesk9-mz.124-15.T1.binAddress or name of remote host []? 192.168.1.2Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]? c1841.binWriting c1841-advipservicesk9-mz.124-15.T1.bin...[OK - 33591768 bytes]33591768 bytes copied in 346.13 secs (97000 bytes/sec)Router#Router#Router#

7、到FTP伺服器上去看是否有了這個檔案;

有c1841.bin檔案了,說明備份成功。

8、還原升級和TFTP升級方法類似,不再贅述。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.