Lab 2-5: Làm việc với tftp server
Mô tả
Backup các file cấu hình của switch vào TFTP server
Nạp lại file backup từ TFTP server.
Thực hiện
1. Đặt IP address cho host có TFTP server
2. Đặt IP address cho management VLAN
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname ALSwitch
ALSwitch(config)#int vlan 1
ALSwitch(config-if)#ip address 10.1.1.251 255.255.255.0
ALSwitch(config-if)#no shut
3. Cấu hình cho port gắn với TFTP server ở access mode (giả sử là port f0/9)
ALSwitch(config-if)#int f0/9
ALSwitch(config-if)#switchport mode access
ALSwitch(config-if)#switchport access vlan 1
ALSwitch(config-if)#no shut
ALSwitch(config-if)#
01:38:36: %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to up
01:38:36: %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to up
4. Kiểm tra kết nối giữa switch với tftp server
ALSwitch#ping 10.1.1.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms
ALSwitch#
5. Xem nội dung flash:
ALSwitch#show flash
Directory of flash:/
2 -rwx 1645824 Mar 01 1993 00:27:37 bootfile
4 -rwx 1180 Mar 01 1993 00:26:01 config.text
8 -rwx 976 Mar 01 1993 00:41:54 config.old
9 -rwx 17 Jan 01 1970 00:00:20 env_vars
3612672 bytes total (1960448 bytes free)
ALSwitch#
6. Copy cấu hình hiện tại vào tftp server
ALSwitch#copy running-config tftp
Address or name of remote host []? 10.1.1.10
Destination filename [running-config]? running-config.txt
!!
685 bytes copied in 1.106 secs (685 bytes/sec)
ALSwitch#
7. Copy startup-config vào tftp server
ALSwitch#copy startup-config tftp
Address or name of remote host []? 10.1.1.10
Destination filename [startup-config]? startup-config.txt
!!
685 bytes copied in 0.84 secs
ALSwitch#
8. Copy file config.text từ flash vào tftp server
ALSwitch#copy flash:config.text tftp
Address or name of remote host []? 10.1.1.10
Destination filename [config.text]? Ấn Enter
!!
685 bytes copied in 0.89 secs
Chú ý file startup-config.txt và config.text có nội dung giống nhau.
9. Copy biến môi trường vào tftp server để xem tham số
ALSwitch#copy env_vars tftp
Address or name of remote host []? 10.1.1.10
Destination filename [env_vars]?
!!
17 bytes copied in 0.79 secs
ALSwitch#
10. Copy bootfile vào tftp server
ALSwitch#copy bootfile tftp
Address or name of remote host []? 10.1.1.10
Destination filename [bootfile]? switch2900XL.bin
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!
1645824 bytes copied in 13.657 secs (126601 bytes/sec)
Xem version của switch
ALSwitch#show version
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5.2)XU, ROM: Bootstrap program is C2900XL boot loader
System image file is "flash:bootfile"
cisco WS-C2912-XL (PowerPC403GA) processor (revision 0x11) with 8192K/1024K
...
File Switch2900XL.bin có kích thước giống file c2900XL-c3h2s-mz-120.5.2-XU.bin có sẵn trong flash
11. Upload lại file từ tftp lên switch
ALSwitch#copy tftp:c2900XL-c3h2s-mz-120.5.2-XU.bin flash
Address or name of remote host []? 10.1.1.10
Destination filename [c2900XL-c3h2s-mz-120.5.2-XU.bin]? Ấn Enter
Accessing tftp://10.1.1.10/c2900XL-c3h2s-mz-120.5.2-XU.bin...
Loading c2900XL-c3h2s-mz-120.5.2-XU.bin from 10.1.1.10 (via VLAN1): !!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!
[OK - 1645810 bytes]
1645810 bytes copied in 55.266 secs (29923 bytes/sec)
ALSwitch#
12. Xem cấu hình sau khi upload
ALSwitch#sh flash
Directory of flash:/
2 -rwx 1645824 Mar 01 1993 00:27:37 bootfile
4 -rwx 685 Mar 01 1993 01:53:49 config.text
5 -rwx 1645810 Mar 01 1993 02:07:53 c2900XL-c3h2s-mz-120.5.2-XU.bin
9 -rwx 17 Jan 01 1970 00:00:20 env_vars
3612672 bytes total (314880 bytes free)
ALSwitch#
Comment