带您认识 VRP 特性,附实战配置!
一、 实验目的
- 掌握如何进入和退出系统视图。
- 掌握配置设备名称,时间及时区的方法。
- 掌握配置登录标语信息。
- 掌握配置接口IP地址和描述,及ping命令的使用。
- 掌握基本的telnet配置并测试。
- 掌握查看设备上的存储文件列表,及查看和管理配置文件的方法。
二、 实验拓扑

三、 实验步骤
1、进入和退出系统视图
<Huawei>system-view Entersystemview,returnuserviewwithCtrl+Z. [Huawei]quit <Huawei>
备注:无论在何种视图下,按“Ctrl+Z”均可直接退到用户视图下。
2、配置设备名称
<Huawei>system-view Entersystemview,returnuserviewwithCtrl+Z. [Huawei]sysnameAR1 [AR1]
3、配置时间及时区
[AR1]quit <AR1>displayclock 2012-12-0520:40:46 Wednesday TimeZone(UTC):UTC <AR1>clocktimezoneChinaadd08:00:00 <AR1>b 2012-12-0520:40:50+08:00 Wednesday TimeZone(China):UTC+08:00 <AR1>clockdatetime16:41:002012-12-06 <AR1>displayclock 2012-12-0616:41:41+08:00 Thursday TimeZone(China):UTC+08:00 <AR1>
4、配置登陆标语信息
<AR1>system-view Entersystemview,returnuserviewwithCtrl+Z. [AR1]headerlogininformation"WELCOMETOHUAWEI-AR1"
5、配置接口IP地址和描述,及ping命令的使用
[AR1]interfaceEthernet0/0/0 [AR1-Ethernet0/0/0]ipaddress1.0.0.130 [AR1-Ethernet0/0/0]descriptionTO-PC1 [AR1-Ethernet0/0/0]ping1.0.0.2 PING1.0.0.2:56databytes,pressCTRL_Ctobreak Replyfrom1.0.0.2:bytes=56Sequence=1ttl=128time=230ms Replyfrom1.0.0.2:bytes=56Sequence=2ttl=128time=20ms Replyfrom1.0.0.2:bytes=56Sequence=3ttl=128time=10ms Replyfrom1.0.0.2:bytes=56Sequence=4ttl=128time=1ms Replyfrom1.0.0.2:bytes=56Sequence=5ttl=128time=20ms ---1.0.0.2pingstatistics--- 5packet(s)transmitted 5packet(s)received 0.00%packetloss round-tripmin/avg/max=1/56/230ms [AR1-Ethernet0/0/0]quit [AR1]
6、配置基本的telnet功能并测试
[AR1]aaa [AR1-aaa]local-userhuaweipasswordcipherhuawei Info:Addanewuser. [AR1-aaa]local-userhuaweiservice-typetelnet [AR1-aaa]local-userhuaweiprivilegelevel3 [AR1-aaa]quit [AR1]user-interfacevty04 [AR1-ui-vty0-4]authentication-modeaaa [AR1-ui-vty0-4]quit [AR1]quit <AR1>telnet127.0.0.1 Trying127.0.0.1... PressCTRL+Ktoabort Connectedto127.0.0.1... WELCOMETOHUAWEI-AR1 Loginauthentication Username:huawei Password: Info:ThemaxnumberofVTYusersis10,andthenumber ofcurrentVTYusersonlineis1. Thecurrentlogintimeis2012-12-0616:59:09. <AR1>
备注:模拟器中PC机不支持telnet,所以这里在设备上直接telnet自己的环回地址或自身任何一个UP的接口地址进行测试。
7、查看设备上的存储文件列表
[AR1]quit <AR1>save Thecurrentconfigurationwillbewrittentothedevice. Areyousuretocontinue?[Y/N]y Info:Pleaseinputthefilename(*.cfg,*.zip)[vrpcfg.zip]: Dec6201217:05:34+08:00AR1%%01CFM/4/SAVE(l)[4]:TheuserchoseYwhendecidi ngwhethertosavetheconfigurationtothedevice. Nowsavingthecurrentconfigurationtotheslot17. Savetheconfigurationsuccessfully. <AR1>dir Directoryofflash:/ IdxAttrSize(Byte)DateTimeFileName 0drw--Dec06201216:26:50src 1drw--Dec06201216:26:53logfile 2drw--Dec06201216:27:01pmdata 3-rw-4Dec06201216:27:07snmpnotilog.txt 4drw--Dec06201216:27:18dhcp 5-rw-603Dec06201217:05:37private-data.txt 6drw--Dec06201216:41:10mplstpoam 7-rw-570Dec06201217:05:36vrpcfg.zip 32,004KBtotal(31,990KBfree) <AR1>
8、查看和管理配置文件的方法
8.1备份配置文件
<AR1>copyvrpcfg.zipvrpcfg_backup.zip Copyflash:/vrpcfg.ziptoflash:/vrpcfg_backup.zip?[Y/N]:y 100%complete Info:Copiedfileflash:/vrpcfg.ziptoflash:/vrpcfg_backup.zip...Done. <AR1>dir Directoryofflash:/ IdxAttrSize(Byte)DateTimeFileName 0drw--Dec06201216:26:50src 1drw--Dec06201216:26:53logfile 2drw--Dec06201216:27:01pmdata 3-rw-4Dec06201216:27:07snmpnotilog.txt 4drw--Dec06201216:27:18dhcp 5-rw-603Dec06201217:05:37private-data.txt 6drw--Dec06201216:41:10mplstpoam 7-rw-570Dec06201217:12:53vrpcfg_backup.zip 8-rw-570Dec06201217:05:36vrpcfg.zip 32,004KBtotal(31,989KBfree)
8.2 解压缩备份的配置文件
<AR1>unzipvrpcfg_backup.zipvrpcfg_backup.txt Extractflash:/vrpcfg_backup.ziptoflash:/vrpcfg_backup.txt?[Y/N]:y 100%complete %Decompressedfileflash:/vrpcfg_backup.ziptoflash:/vrpcfg_backup.txt. <AR1>dir Directoryofflash:/ IdxAttrSize(Byte)DateTimeFileName 0drw--Dec06201216:26:50src 1drw--Dec06201216:26:53logfile 2drw--Dec06201216:27:01pmdata 3-rw-4Dec06201216:27:07snmpnotilog.txt 4drw--Dec06201216:27:18dhcp 5-rw-603Dec06201217:05:37private-data.txt 6drw--Dec06201216:41:10mplstpoam 7-rw-570Dec06201217:12:53vrpcfg_backup.zip 8-rw-570Dec06201217:05:36vrpcfg.zip 9-rw-1,066Dec06201217:14:40vrpcfg_backup.txt 32,004KBtotal(31,987KBfree)
8.3 查看txt文件
<AR1>morevrpcfg_backup.txt # sysnameAR1 # aaa authentication-schemedefault authorization-schemedefault accounting-schemedefault domaindefault domaindefault_admin local-useradminpasswordcipherOOCM4m($F4ajUn1vMEIBNUw# local-useradminservice-typehttp local-userhuaweipasswordcipherT/PkV[U[kE@X,k6.E\Z,7B;# local-userhuaweiprivilegelevel3 local-userhuaweiservice-typetelnet # firewallzoneLocal priority16 # interfaceEthernet0/0/0 descriptionTO-PC1 ipaddress1.0.0.1255.255.255.252 # interfaceEthernet0/0/1 ----More----
备注:查看配置时最简单的方法是通过display current-configuration或display saved-configuration命令来查看,这里所说的备份、解压缩、查看配置文件目的只是用来指导如何对文件进行操作。
8.4 修改文件名
<AR1>renamevrpcfg_backup.txtpeizhi.txt Renameflash:/vrpcfg_backup.txttoflash:/peizhi.txt?[Y/N]:y Info:Renamefileflash:/vrpcfg_backup.txttoflash:/peizhi.txt......Done. <AR1>dir Directoryofflash:/ IdxAttrSize(Byte)DateTimeFileName 0drw--Dec06201216:26:50src 1drw--Dec06201216:26:53logfile 2drw--Dec06201216:27:01pmdata 3-rw-4Dec06201216:27:07snmpnotilog.txt 4drw--Dec06201216:27:18dhcp 5-rw-603Dec06201217:05:37private-data.txt 6drw--Dec06201216:41:10mplstpoam 7-rw-570Dec06201217:12:53vrpcfg_backup.zip 8-rw-570Dec06201217:05:36vrpcfg.zip 9-rw-1,066Dec06201217:14:40peizhi.txt 32,004KBtotal(31,987KBfree)
备注:系统在用的关键文件文件名不能被修改,例如在用的配置文件、版本、补丁。
8.5 删除文件
<AR1>deletepeizhi.txt Deleteflash:/peizhi.txt?[Y/N]:y Info:Deletingfileflash:/peizhi.txt...succeeded. <AR1>dir Directoryofflash:/ IdxAttrSize(Byte)DateTimeFileName 0drw--Dec06201216:26:50src 1drw--Dec06201216:26:53logfile 2drw--Dec06201216:27:01pmdata 3-rw-4Dec06201216:27:07snmpnotilog.txt 4drw--Dec06201216:27:18dhcp 5-rw-603Dec06201217:05:37private-data.txt 6drw--Dec06201216:41:10mplstpoam 7-rw-570Dec06201217:12:53vrpcfg_backup.zip 8-rw-570Dec06201217:05:36vrpcfg.zip 32,004KBtotal(31,986KBfree)
备注:系统在用的关键文件文件名不能被修改,例如在用的配置文件、版本、补丁;文件删除后是被放在回收站中。
8.6 恢复被删除文件
<AR1>undeletepeizhi.txt Undeleteflash:/peizhi.txt?[Y/N]:y %Undeletedfileflash:/peizhi.txt. <AR1>dir Directoryofflash:/ IdxAttrSize(Byte)DateTimeFileName 0drw--Dec06201216:26:50src 1drw--Dec06201216:26:53logfile 2drw--Dec06201216:27:01pmdata 3-rw-4Dec06201216:27:07snmpnotilog.txt 4drw--Dec06201216:27:18dhcp 5-rw-603Dec06201217:05:37private-data.txt 6drw--Dec06201216:41:10mplstpoam 7-rw-570Dec06201217:12:53vrpcfg_backup.zip 8-rw-570Dec06201217:05:36vrpcfg.zip 9-rw-1,066Dec06201217:14:40peizhi.txt 32,004KBtotal(31,986KBfree)
8.7删除文件并清空回收站
<AR1>deletepeizhi.txt Deleteflash:/peizhi.txt?[Y/N]:y Info:Deletingfileflash:/peizhi.txt...succeeded. <AR1>resetrecycle-bin Squeezeflash:/peizhi.txt?[Y/N]:y %Clearedfileflash:/peizhi.txt. <AR1>
8.8彻底删除文件
<AR1>delete/unreservedvrpcfg_backup.zip Warning:Thecontentsoffileflash:/vrpcfg_backup.zipcannotberecycled.Conti nue?[Y/N]:y Info:Deletingfileflash:/vrpcfg_backup.zip...succeeded. <AR1>resetrecycle-bin Error:Filecan'tbefound.
备注:彻底删除文件,是指不经过回收站(所以上面在清空回收站的时候,提示回收站是空的),直接将文件彻底删除,被彻底删除的文件无法被恢复。
四、 思考及感想
- 上述的命令是使用数通设备时最基本的命令;
- 时间、时区、修改设备名、配置登陆标语是为了便于日常的维护;
- 在进行telnet测试时,尤其是对于只有当前一台设备的情况下,最经常采用的方法就是telnet自己的环回地址127.0.0.1;
- 系统文件的操作命令只能在用户视图下进行,就是常说的尖括号模式下;
- 在任何模式下都可以通过“ctrl+z”退到用户视图下;
- 系统文件的命令在设备升级时要用到,所以属于必须掌握项目;
- 对于命令单词记忆不全,可以通过键盘上的“tab”键来匹配;
- 对于命令参数记不住或不知道具体含义,可以通过打“?”号来获得提示。
文章为作者独立观点,不代表BOSS直聘立场。未经账号授权,禁止随意转载。