资源描述
实验一 常用设备管理操作
一、实验目的:
掌握通过console登录设备
掌握修改设备名称
掌握显示、修改系统时间
掌握四种命令视图
掌握查看版本、当前配置、接口信息
二、实验描述及组网图:
三、实验步骤:
实验任务一:
使用console口进行设备的连接
1、通过console口将pc机与交换机或者路由器相连。
2、通过超级终端进行连接:
首先,通过【开始】|【所有程序】|【附件】|【超级终端】启动超级终端程序并创建一个新连接,输入一个连接的名字。
3、选择所用的通讯串口(com)
注:com口信息在“我的电脑”“管理”下的设备管理器中查看到。
4、设置属性参数,在串口属性中设置波特率为9600,参数位为8,奇偶校验为无,停止位为1,流量控制为无。(可以使用“还原为默认值”就能完成参数配置)。
5、设置好参数后,直接点击【确认】,就可以进入到如下的设置界面。就可以对设备进行配置。
实验任务二:
掌握四种命令视图
1、进入用户试图:
如上图,通过console口登录到设备上的时候就进入了用户视图。
在这个视图中使用的是用来查看设备启动后基本的运行状态和统计信息的命令。
2、进入系统视图
<H3C>system-view
[H3C]
在这个视图下配置系统全局通用参数。
注:使用<Tab>键系统可以自动补全命令
<H3C>sys
按<Tab>键自动补全
如果有多个一这样的字母开头的命令则按<tab>键会逐个的出现在屏幕上。
<H3C>system-view
3、路由协议视图
在这个协议下能够配置路由协议参数。路由协议的大部分参数都在此视图下配置。
根据使用的不同的路由协议进入该视图的命令也不同,例如使用rip协议则通过
[H3C]rip
[H3C-rip-1]
如果使用ospf协议则使用
[H3C]ospf
[H3C-ospf-1]
4、接口视图
在这个视图下可以配置接口参数:在interface后面加上接口名称
[H3C]interface Serial 0/2/0
[H3C-Serial0/2/0]
5、用户界面视图
在这个视图下可以配置登录设备的各个用户属性
通过在用户界面视图下的各种操作,可以达到统一管理各个用户的目的。
注:任意视图下可以使用quit命令推出此视图。切换到前一级视图。
任意视图下使用<Ctrl+Z>可以直接退回用户视图。
敲命令的时候可以使用“?”帮助功能在某一下视图下或者某一个命令的后面输入“?”可以显示出在这一视图下或者在这个命令后面可以使用哪一些命令。
实验任务三:
设备的基本操作命令:
1、修改配置设备名称:
[H3C]sysname ?
TEXT Host name (1 to 30 characters)
例如将设备名称改为jiance
[H3C]sysname jiance
[jiance]
2、配置系统时间:
<jiance>clock datetime ?
TIME Specify the time (HH:MM:SS)
设置时间格式为HH:MM:SS
<jiance>clock datetime 14:46:10 ?
DATE Specify the date from 2000 to 2035 (MM/DD/YYYY or YYYY/MM/DD)
设置日期的格式为MM/DD/YYYY或者YYYY/MM/DD
例如:将日期修改为2010/3/31 时间改为14:46:10
<jiance>clock datetime 14:46:10 2010/3/31
3、显示系统时间:
<jiance>display clock
14:46:29 UTC Wed 03/31/2010
4、由于系统有自动识别功能,所以在输入命令时为方便操作,有时仅需输入前面的几个字符即可,但是前提是这几个字符可以唯一表示一条命令。
例如:显示系统时间可以用
<jiance>dis clo
14:46:29 UTC Wed 03/31/2010
5、查看版本信息:
<jaince>display version
H3C Comware Platform Software
Comware Software, Version 5.20, Alpha 1011
Copyright (c) 2004-2007 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
SIMWARE uptime is 0 week, 0 day, 1 hour, 52 minutes
可以看到软件平台为comware,版本为5.20 第三行是版权信息。第四行是启动时间。
6、显示当前配置:
<jiance>display current-configuration
#
version 5.20, Alpha 1011
#
sysname H3C
#
password-control login-attempt 3 exceed lock-time 120
#
undo voice vlan mac-address 00e0-bb00-0000
#
ipsec cpu-backup enable
#
undo cryptoengine enable
#
domain default enable system
#
vlan 1
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
---- More ----
可以通过空格键进行翻页显示,<Enter>进行翻行显示,或者<Ctrl+C>结束显示。这里使用空格键继续显示。
interface Ethernet0/1/0
port link-mode route
ip address 10.10.10.10 255.255.255.0
#
interface Serial0/2/0
link-protocol ppp
#
interface Serial0/2/1
link-protocol ppp
#
interface NULL0
#
interface Ethernet0/4/0
port link-mode bridge
#
interface Ethernet0/4/1
port link-mode bridge
#
interface Ethernet0/4/2
port link-mode bridge
#
interface Ethernet0/4/3
port link-mode bridge
#
interface Ethernet0/4/4
port link-mode bridge
#
interface Ethernet0/4/5
port link-mode bridge
#
interface Ethernet0/4/6
port link-mode bridge
#
interface Ethernet0/4/7
port link-mode bridge
#
load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return
在配置中你可以看到在设备上的一些配置信息。
实验任务四:
文件的基本操作命令。
1、保存配置命令:
<jiance>save
The current configuration will be written to the device. Are you sure? [Y/N]:y
选择y,表示确定将当前配置文件写入存储介质中。
(To leave the existing filename unchanged, press the enter key):
Validating file. Please wait...
Now saving current configuration to the device.
Saving configuration flash:/startup.cfg. Please wait...
..
也可以更改保存的文件名称:
[H3C]save jiance.cfg
The current configuration will be saved to flash:/jiance.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration flash:/jiance.cfg. Please wait...
.
显示保存的配置文件:
<jiance>dis saved-configuration
#
version 5.20, Release 1809P01, Standard
#
sysname jiance
#
super password level 3 simple h3c
#
domain default enable system
#
telnet server enable
#
dar p2p signature-file cfa0:/p2p_default.mtd
#
port-security enable
#
vlan 1
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
user-group system
#
local-user admin
password cipher .]@USE=B,53Q=^Q`MAF4<1!!
authorization-attribute level 3
service-type telnet
local-user jiance
password simple jiance
service-type telnet
#
interface Aux0
async mode flow
link-protocol ppp
#
interface Cellular0/0
async mode protocol
link-protocol ppp
#
interface Ethernet0/0
port link-mode route
ip address 192.168.1.2 255.255.255.0
#
interface Ethernet0/1
port link-mode route
#
interface Serial1/0
link-protocol ppp
#
interface Serial2/0
link-protocol ppp
#
interface NULL0
#
load xml-configuration
#
load tr069-configuration
#
user-interface con 0
user-interface tty 13
user-interface aux 0
user-interface vty 0 4
authentication-mode none
user privilege level 3
set authentication password simple h3c
#
return
可以显示已经保存的配置文件。如果你没有保存的配置文件时,使用该命令是不能显示任何的配置信息的。
2、删除和清空配置文件。
<jiance>reset saved-configuration
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in flash is being cleared.
Please wait ...
.
Configuration file in flash is cleared.
通过这个命令可以清除掉配置。这时候使用
<jiance>dis saved-configuration
没有配置文件。但是使用
<H3C>dis current-configuration
配置信息还存在于当前配置文件中。
这时候还要通过使用reboot命令重启设备。才能真正的清空配置。
3、显示文件目录:
<jiance>pwd
flash:
表示当前路径是flash:中
4、显示当前路径的所有文件列表。
<jiance>dir
Directory of cfa0:/
0 -rw- 12629732 Sep 19 2008 14:24:16 main.bin
1 drw- - Mar 05 2009 20:59:36 logfile
2 -rw- 18321 Apr 06 2010 17:45:18 config.cwmp
3 -rw- 18494008 Oct 07 2009 14:54:18 msr20-cmw520-r1809p01-si.bin
4 -rw- 1197 Apr 06 2010 17:30:04 startup.cfg
5 -rw- 33 Apr 06 2010 17:45:16 system.xml
6 -rw- 1197 Apr 06 2010 17:45:20 jiance.cfg
254692 KB total (222936 KB free)
File system type of cfa0: FAT16
5、显示文本文件内容。
<jiance>more jiance.cfg
#
version 5.20, Release 1809P01, Standard
#
sysname jiance
#
super password level 3 simple h3c
#
domain default enable system
#
telnet server enable
#
dar p2p signature-file cfa0:/p2p_default.mtd
#
port-security enable
#
vlan 1
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
user-group system
#
local-user admin
password cipher .]@USE=B,53Q=^Q`MAF4<1!!
authorization-attribute level 3
service-type telnet
local-user jiance
password simple jiance
service-type telnet
#
interface Aux0
async mode flow
link-protocol ppp
#
interface Cellular0/0
async mode protocol
link-protocol ppp
#
interface Ethernet0/0
port link-mode route
ip address 192.168.1.2 255.255.255.0
#
interface Ethernet0/1
port link-mode route
#
interface Serial1/0
link-protocol ppp
#
interface Serial2/0
link-protocol ppp
#
interface NULL0
#
load xml-configuration
#
load tr069-configuration
#
user-interface con 0
user-interface tty 13
user-interface aux 0
user-interface vty 0 4
authentication-mode none
user privilege level 3
set authentication password simple h3c
#
return
显示jiance.cfg文件中的内容。
6、改变当前工作路径
使用cd命令
例如:
<jiance>cd logfile
进入logfile子目录
7、文件删除:
使用delete命令删除文件。
使用dir命令查看文件中有一个之前保存的文件:jiance.cfg文件。
注意:保存时因为保存的是配置文件,所以要用 .cfg为后缀名,
<jiance>dir
Directory of cfa0:/
0 -rw- 12629732 Sep 19 2008 14:24:16 main.bin
1 drw- - Mar 05 2009 20:59:36 logfile
2 -rw- 18321 Apr 06 2010 17:45:18 config.cwmp
3 -rw- 18494008 Oct 07 2009 14:54:18 msr20-cmw520-r1809p01-si.bin
4 -rw- 1197 Apr 06 2010 17:30:04 startup.cfg
5 -rw- 33 Apr 06 2010 17:45:16 system.xml
6 -rw- 1197 Apr 06 2010 17:45:20 jiance.cfg
254692 KB total (222936 KB free)
File system type of cfa0: FAT16
删除文件名为jiance.cfg的文件。
<jiance>delete jiance.cfg
Delete flash:/jiance.cfg?[Y/N]:y
%Delete file flash:/jiance.cfg...Done.
再次使用dir命令查看。
<jiance>dir
Directory of cfa0:/
0 -rw- 12629732 Sep 19 2008 14:24:16 main.bin
1 drw- - Mar 05 2009 20:59:36 logfile
2 -rw- 18321 Apr 06 2010 17:45:18 config.cwmp
3 -rw- 18494008 Oct 07 2009 14:54:18 msr20-cmw520-r1809p01-si.bin
4 -rw- 1197 Apr 06 2010 17:30:04 startup.cfg
5 -rw- 33 Apr 06 2010 17:45:16 system.xml
254692 KB total (222932 KB free)
File system type of cfa0: FAT16
但是flash中的空间并没有减少。
使用dir /all命令查看时:
<jiance>dir /all
Directory of cfa0:/
0 -rw- 12629732 Sep 19 2008 14:24:16 main.bin
1 drw- - Mar 05 2009 20:59:36 logfile
2 -rwh 388 Apr 06 2010 17:45:16 private-data.txt
3 -rwh 716 Mar 16 2010 12:00:42 hostkey
4 -rwh 572 Mar 16 2010 12:00:42 serverkey
5 -rw- 18321 Apr 06 2010 17:45:18 config.cwmp
6 -rw- 18494008 Oct 07 2009 14:54:18 msr20-cmw520-r1809p01-si.bin
7 -rw- 1197 Apr 06 2010 17:30:04 startup.cfg
8 -rw- 33 Apr 06 2010 17:45:16 system.xml
9 -rw- 1197 Apr 06 2010 17:45:20 [jiance.cfg]
254692 KB total (222932 KB free)
File system type of cfa0: FAT16
发现文件仍然在flash中。
flash的空间。所以要将回收站清空。
<jiance>reset recycle-bin
Clear cfa0:/~/jiance.cfg ?[Y/N]:y
%Cleared file cfa0:/~/jiance.cfg.
再次查看flash
<jiance>dir /all
Directory of cfa0:/
0 -rw- 12629732 Sep 19 2008 14:24:16 main.bin
1 drw- - Mar 05 2009 20:59:36 logfile
2 -rwh 388 Apr 06 2010 17:45:16 private-data.txt
3 -rwh 716 Mar 16 2010 12:00:42 hostkey
4 -rwh 572 Mar 16 2010 12:00:42 serverkey
5 -rw- 18321 Apr 06 2010 17:45:18 config.cwmp
6 -rw- 18494008 Oct 07 2009 14:54:18 msr20-cmw520-r1809p01-si.bin
7 -rw- 1197 Apr 06 2010 17:30:04 startup.cfg
8 -rw- 33 Apr 06 2010 17:45:16 system.xml
254692 KB total (222940 KB free)
File system type of cfa0: FAT16
发现文件已经完全的删除了。而且flash空间也增加了。
五、其他命令:
1、配置登录时的信息:
[jiance]header legal %welcome to H3C%
当你再次登录到设备的时候就会显示welcome to H3C 的登录信息。
展开阅读全文