最详细的华为VRP操作指南_华为vrp

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

第二章华为VRP系统

通用路由平台VRPVersatile Routing Platform是华为公司数据通信产品的通用操作系统平台。它以IP业务为核心采用组件化的体系结构在实现丰富功能特性的同时还提供了基于应用的可裁剪和可扩展的功能使得路由器和交换机的运行效率大大增加。熟悉VRP操作系统并且熟练掌握VRP配置是高效管理华为网络设备的必备基础。

2.1VRP概述

随着网络技术和应用的飞速发展VRP平台在处理机制、业务能力、产品支持等方面也在持续演进。到目前为止VRP已经开发出了5个版本分别是VRP1、VRP2、VRP3、VRP5和VRP8。

  1. VRP版本
  1. VRP11998年-2001年
  1. 集中式设计
  2. 适用中低端设备
  3. 性能比较低
  1. VRP2 1999年-2000年
  1. 分布式设计

  1. VRP32000年-2004年
  1. 分布式平台
  2. 支持众多特性
  3. 支持核心路由器
  1. VRP52004年-now
  1. 组件化设计
  2. 应用于华为多个产品
  3. 高性能

  1. VRP8 2009年-now
  1. 多进程
  2. 组件化设计
  3. 支持多CPU、多框
  1. 文件系统

华为设备的文件系统如表2-1所示

                                                        表2-1 华为设备文件类型

文件类型

功能

系统软件

系统软件是设备启动、运行的必备软件为整个设备提供支撑、管理、业务等功能。常见文件后缀名为.cc

配置文件

配置文件是用户将配置命令保存的文件作用是允许设备以指定的配置启动生效。常见文件后缀名为(.cfg, .zip , .dat)。

补丁文件

补丁是一种与设备系统软件兼容的软件用于解决设备系统软件少量且急需解决的问题。常见文件后缀名为(.pat)。

PAT文件

PAF文件是根据用户对产品需要提供了一个简单有效的方式来裁剪产品的资源占用和功能特性。常见文件后缀名为(.bin)。

                                 

  1. 存储设备

华为设备的存储设备如表2-2所示

                                              表2-2 华为设备存储设备

存储设备

功能

Flash

属于非易失存储器断电后不会丢失数据。主要存放系统软件配置文件等补丁文件和PAF文件由维护人员上传一般存储于flash或SD Card中。

NVRAM

非易失随机读写存储器用于存储日志缓存文件定时器超时或缓存满后再写入Flash。

SDRAM

同步动态随机存储器是系统运行内存,相当于电脑的内存。

SD Card

断电后不会丢失数据。存储容量较大一般出现在主控板上可以存放系统文件配置文件日志等。

USB

USB是接口用于外接大容量存储设备主要用于设备升级传输数据。

  1. 用户级别

华为设备的用户级别如表2-3所示

                                                          表2-3 华为设备命令行级别

用户等级

命令等级

名称

说明

0

0

参观级

可使用网络诊断工具命令ping、tracert、从本设备出发访问外部设备的命令Telnet客户端命令、部分display命令等。

1

0 and 1

监控级

用于系统维护可使用display等命令。

2

01 and 2

配置级

可使用业务配置命令包括路由、各个网络层次的命令向用户提供直接网络服务。

3-15

012 and 3

管理级

可使用用于系统基本运行的命令对业务提供支撑作用包括文件系统、FTP、TFTP下载、命令级别设置命令以及用于业务故障诊断的debugging命令等。

5、命令行视图

   VRP的视图可以分为用户视图、系统视图、接口视图、协议视图等。如图2-1所示

图2-1 华为设备的视图示意图

6、命令行帮助和在线帮助

VRP的常用快捷操作如表2-4所示

                                                          表2-4 VRP常用快捷操作

命令

功能

Ctrl+A

把光标移动到当前命令行的最前端

Ctrl+E

把光标移动到当前命令行的最尾端

Ctrl+C

停止当前命令的运行命令并不执行

Ctrl+Z

直接回到用户视图

Ctrl+]

终止当前连接或切换连接如终止 Telnet 连接等

Ctrl+U

删除整行命今行

Backspace

刷除光标左边的第一个字符

Ctrl+B or <

光标左移一位

Ctrl+F or >

光标右移一位

Tab

输入一个不完整的命令并按Tab 键就可以补全该命令读者可以体验一下多按几次 Tab 键的给出

2.2实验一VRP的基本操作

1、实验目的

  • 理解命令行视图的含义以及进入离开命令行视图的方法
  • 掌握一些常见的命令
  • 掌握使用命令行在线帮助的方法
  • 掌握如何撤销命令
  • 掌握如何使用命令行快捷键

2、实验拓扑

VRP的基本操作实验拓扑如图2-2所示。

图2-2 VRP的基本操作

3、实验步骤

1熟悉VRP的视图

<Huawei>    //用户视图

<Huawei>system-view   //从用户视图进入到系统视图

Enter system view, return user view with Ctrl+Z.

[Huawei]      //[ ] 代表系统视图

[Huawei]interface GigabitEthernet 0/0/0  //从系统视图进入到接口视图

[Huawei-GigabitEthernet0/0/0]ip add      //我们只输入“ip add”然后按Tab键就可以补全“address”

[Huawei-GigabitEthernet0/0/0]ip address 10.1.1.1 24  //配置接口IP地址为10.1.1.1 掩码长度为24位。

[Huawei-GigabitEthernet0/0/0]quit  //quit命令是VRP系统中的退出当前层级命令。

[Huawei]ospf   // 进入到ospf协议视图

[Huawei-ospf-1]  // ospf是我们后面要学习的一个非常重要的动态路由协议此处仅作为一个示例。

【技术要点1】

Tab键的使用如果与之匹配的关键字唯一按下<Tab>键系统自动补全关键字补全后反复按<Tab>关键字不变。示例如下

[Huawei] info-                            //按下Tab键

[Huawei] info-center

【技术要点2】

  退出命令我们可以用quit、return、和快捷键“Ctrl+z”。

  • Quit命令仅可以返回上一个视图
  • Return命令直接返回到用户视图
  • 快捷键“Ctrl+z”和return一样

2给设备命名

[Huawei]sysname joinlabs    //更改系统名为joinlabs

[joinlabs]          //读者可以看到系统名由Huwei变成了joinlabs

3查看当前运行的配置文件

<joinlabs>display current-configuration    //查看当前运行的配置文件

#

sysname joinlabs  //系统名为joinlabs

#

aaa

 authentication-scheme default

 authorization-scheme default

 accounting-scheme default

 domain default

 domain default_admin

 local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#

 local-user admin service-type http

#

firewall zone Local

 priority 16

#

interface Ethernet0/0/0

#

interface Ethernet0/0/1

#

interface Serial0/0/0

 link-protocol ppp

#

interface Serial0/0/1

 link-protocol ppp

#

interface Serial0/0/2

 link-protocol ppp

#

interface Serial0/0/3

 link-protocol ppp

#

interface GigabitEthernet0/0/0

#

interface GigabitEthernet0/0/1

#

interface GigabitEthernet0/0/2

#

interface GigabitEthernet0/0/3

#

wlan

#

interface NULL0

#

ospf 1   //ospf进程1

#

user-interface con 0

user-interface vty 0 4

user-interface vty 16 20

#

return

【技术要点】

   有读者会问刚刚我们只配置了系统名和OSPF为什么还有这么多的命令

因为除了“sysname joinlabs”“ospf 1  ” 其它的都是预配这些配置都是系统本身自带的。

4保存当前的配置

<joinlabs>save   //保存

The current configuration will be written to the device  //当前这些配置将会保存到设备

Are you sure to continue?[Y/N]Y  //你是否继续选择Y

Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:  //如果不改名默认为vrpcfg.zip

May 16 2022 15:40:18-08:00 joinlabs %%01CFM/4/SAVE(l)[0]:The user chose Y when deciding whether to save the configuration to the device.

Now saving the current configuration to the slot 17.

Save the configuration successfully.

<joinlabs>

【技术要点】

如果读者给设备做了配置没有保存那么文件只在RAM里面下次重启配置就没有了。

所以大家一家要记得保存只要保存了文件就就进入了Flash/SD卡里面了下次重启时配置还在。

  

5查看保存的配置文件

<joinlabs>display saved-configuration    //查看保存的配置文件

#

sysname joinlabs

#

undo info-center enable

#

aaa

 authentication-scheme default

 authorization-scheme default

 accounting-scheme default

 domain default

 domain default_admin

 local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#

 local-user admin service-type http

#

firewall zone Local

 priority 16

#

interface Ethernet0/0/0

#

interface Ethernet0/0/1

#

interface Serial0/0/0

 link-protocol ppp

#

interface Serial0/0/1

 link-protocol ppp

#

interface Serial0/0/2

 link-protocol ppp

#

interface Serial0/0/3

 link-protocol ppp

#

interface GigabitEthernet0/0/0

#

interface GigabitEthernet0/0/1

#

interface GigabitEthernet0/0/2

#

interface GigabitEthernet0/0/3

#

wlan

#

interface NULL0

#

ospf 1

#

user-interface con 0

user-interface vty 0 4

user-interface vty 16 20

#

return

【技术要点】

读者在没有保存之前用display saved-configuration命令查看可以看到为空。

6配置文件重置

<joinlabs>reset saved-configuration   //清空保存的配置文件

Warning: The action will delete the saved configuration in the device.

The configuration will be erased to reconfigure. Continue? [Y/N]:Y  //“配置将会被删除用于重新配置”选择Y

Warning: Now clearing the configuration in the device.

Info: Succeeded in clearing the configuration in the device.

<joinlabs>reboot   //重启只有重新启动配置才能清空。

Info: The system is now comparing the configuration, please wait.

Warning: All the configuration will be saved to the configuration file for the next startup:, Continue?[Y/N]: N     //”所有的配置会被保存到下次启动文件中是否继续”一定要选择N即不保存当前的配置

Info: If want to reboot with saving diagnostic information, input 'N' and then execute 'reboot save diagnostic-information'.

System will reboot! Continue?[Y/N]:Y  //选择Y

【技术要点】

文件重置相当于还原设备的所有配置所以读者在使用些命令前要记得备份。

7指定系统启动配置文件

<joinlabs>save joinlabs.cfg   //保存配置文件配置文件名为joinlabs.cfg

Are you sure to save the configuration to flash:/joinlabs.cfg?[Y/N]:y //选择Y或者是回车

<joinlabs>dir flash:   //查看flash中的文件

Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName

    0  drw-              -  Aug 07 2015 13:51:14   src

    1  drw-              -  May 16 2022 15:05:00   pmdata

    2  drw-              -  May 16 2022 15:05:03   dhcp

    3  -rw-            603  May 16 2022 15:58:22   private-data.txt

    4  drw-              -  May 16 2022 15:20:09   mplstpoam

    5  -rw-            424  May 16 2022 16:02:18   vrpcfg.zip

    6  -rw-            794  May 16 2022 16:04:21   joinlabs.cfg  //可以看到文件保存成功

32,004 KB total (31,991 KB free)

<joinlabs>startup saved-configuration joinlabs.cfg   //指定启动配置文件名

Info: Succeeded in setting the configuration for booting system.

<joinlabs>save   //保存

The current configuration will be written to the device.

Are you sure to continue?[Y/N]y  //选择Y

Save the configuration successfully.

<joinlabs>display startup //使用命令查看设备重启后调用的配置文件

MainBoard:

  Configured startup system software:        NULL

  Startup system software:                   NULL

  Next startup system software:              NULL

  Startup saved-configuration file:          flash:/joinlabs.cfg

  Next startup saved-configuration file:     flash:/joinlabs.cfg   //可以看到设备下次启动时调用的配置文件

  Startup paf file:                            NULL

  Next startup paf file:                     NULL

  Startup license file:                       NULL

  Next startup license file:               NULL

  Startup patch package:                 NULL

  Next startup patch package:         NULL

【技术要点】

在默认情况下设备会调用根目录下的启动文件 而当设备有备份配置文件时可以指定调用的配置文件这样可以灵活地实施项目。

2.3实验二文件查询命令

1、实验目的

  • 掌握文件查询命令

2、实验拓扑

文件查询命令拓扑如图2-13所示。

图2-1 3文件查询命令

3、实验步骤

1查看路由器AR1当前目录

<Huawei>pwd  //查看当前目录

flash:

可以看到当前处于flash目录

步骤查看当前目录下的文件和目录的信息

<Huawei>dir   //显示当前目录下的文件信息

Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  drw-              -  Apr 20 2022 07:21:12   dhcp

    1  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    2  -rw-          2,263  Apr 20 2022 07:21:06   statemach.efs

    3  -rw-        828,482  May 26 2014 09:20:58   sslvpn.zip

1,090,732 KB total (784,464 KB free)

【技术要点】

Attr列表解释如下

‘d’表示当前为目录‘-’表示当前为文件‘r’表示当前目录或文件为可读‘w’ 表示当前目录或文件为可写。

Size表示当前文件和目录的大小。

Filename表示当前目录或文件的名字。

2.4实验三目录和文件操作

1、实验目的

  • 掌握常用的目录操作命令

2、实验拓扑

目录和文件操作实验拓扑如图2-4所示。

图2-2 4目录文件操作

3、实验步骤

1创建一个新目录名字为test

<Huawei>mkdir test    //创建目录test

Info: Create directory flash:/test......Done

2查看当前目录下是否创建了test目录

<Huawei>dir  //显示当前目录下的文件信息

Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  drw-              -  Apr 20 2022 07:29:47   test

    1  drw-              -  Apr 20 2022 07:21:12   dhcp

    2  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    3  -rw-          2,263  Apr 20 2022 07:21:06   statemach.efs

    4  -rw-        828,482  May 26 2014 09:20:58   sslvpn.zip

1,090,732 KB total (784,460 KB free)

可以看到已经创建了test目录。

3删除目录test

<Huawei>rmdir test    //删除目录test

Remove directory flash:/test? (y/n)[n]:y  //‘y’表示确定删除

%Removing directory flash:/test...Done!

4查看当前目录下是否删除了test目录

<Huawei>dir

Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  drw-              -  Apr 20 2022 07:21:12   dhcp

    1  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    2  -rw-          2,263  Apr 20 2022 07:21:06   statemach.efs

    3  -rw-        828,482  May 26 2014 09:20:58   sslvpn.zip

1,090,732 KB total (784,464 KB free)

通过dir显示的结果读者可以看到test目录已经删除了。

(5) 重命名sslvpn.zip文件名为huawei.zip

<Huawei>rename sslvpn.zip huawei.zip   //把sslvpn.zip文件名为huawei.zip

Rename flash:/sslvpn.zip to flash:/huawei.zip? (y/n)[n]:y //选择y

Info: Rename file flash:/sslvpn.zip to flash:/huawei.zip ......Done

6查看是否改名成功

<Huawei>dir

Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  -rw-        828,482  May 26 2014 09:20:58   huawei.zip

    1  drw-              -  Apr 20 2022 07:21:12   dhcp

    2  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    3  -rw-          2,263  Apr 20 2022 07:21:06   statemach.efs

1,090,732 KB total (784,464 KB free)

通过dir显示的结果读者可以看到文件名已改为huawei.zip

(7) 将huawei.zip文件复制并命名为test.txt

<Huawei>copy huawei.zip test.txt    //把 huawei.zip文件复制并命名为test.txt

Copy flash:/huawei.zip to flash:/test.txt? (y/n)[n]:y //选择Y

(8)查看是否修改成功

<Huawei>dir

Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  -rw-        828,482  May 26 2014 09:20:58   huawei.zip

    1  drw-              -  Apr 20 2022 07:21:12   dhcp

    2  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    3  -rw-        828,482  Apr 20 2022 07:40:02   test.txt

4  -rw-          2,263  Apr 20 2022 07:21:06   statemach.efs

通过dri显示的结果可以看到目录中多了一个test.txt的文件。

9将test.txt目录移入dhcp目录并查看

<Huawei>move test.txt dhcp/    //把est.txt目录移入dhcp目录

Move flash:/test.txt to flash:/dhcp/test.txt? (y/n)[n]:y //选择y

%Moved file flash:/test.txt to flash:/dhcp/test.txt.

<Huawei>cd dhcp/  //进入dhcp目录

<Huawei>dir //查看当前目录的文件

Directory of flash:/dhcp/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  -rw-             98  Apr 20 2022 07:21:12   dhcp-duid.txt

    1  -rw-        828,482  Apr 20 2022 07:40:02   test.txt

1,090,732 KB total (783,652 KB free)

通过dir显示的结果可以看到当前目录下多了一个text.txt文件。

10删除text.txt文件

<Huawei>delete test.txt   //删除text.txt文件

Delete flash:/dhcp/test.txt? (y/n)[n]:y   //选择y

Info: Deleting file flash:/dhcp/test.txt...succeed.

<Huawei>dir  //查看当前目录下的文件信息

Directory of flash:/dhcp/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  -rw-             98  Apr 20 2022 07:21:12   dhcp-duid.txt

1,090,732 KB total (783,648 KB free)

通过dir显示的结果可以看到已经不存在text.txt文件。

7恢复text.txt文件并查看

<Huawei>undelete test.txt    //恢复删除的文件test.txt

Undelete flash:/dhcp/test.txt? (y/n)[n]:y  //选择y

%Undeleted file flash:/dhcp/test.txt.

<Huawei>dir //查看当前目录下的文件信息

Directory of flash:/dhcp/

  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName

    0  -rw-             98  Apr 20 2022 07:21:12   dhcp-duid.txt

    1  -rw-        828,482  Apr 20 2022 07:40:02   test.txt

1,090,732 KB total (783,648 KB free)

通过dir显示的结果可以看到text.txt文件已经恢复。

2.5VRP5VRP命令汇总

同上

1表2-5和表2-6是本章出现的命令

表2-5常见的文件系统操作命令汇总

命令

作用

pwd

查看当前目录

dir

显示当前目录下的文件信息

more

查看文本文件的具体内容

cd

修改用户当前界面的工作目录

mkdir

创建新的目录

rmdir

删除目录                   

copy

复制文件

move

移动文件

rename

重命名文件

delete

删除文件

undelete

恢复删除的文件

reset  recycle-bin

彻底删除回收站中的文件

2-6基本配置命令汇总

命令

作用

sysname

配置设备名称

clock datetime

配置本地时区信息

command-privilege level

配置命令等级

display current-configuration

查看当前运行的配置文件

save

配置文件保存

display saved-configuration

查看保存的配置

reset saved-configuration

清除已保存的配置

display startup

查看系统启动配置参数

startup saved-configuration configuration-file 

配置系统下次启动时使用的配置文件

reboot

配置设备重启

本文出自作者的《华为认证HCIA-datacom认证实验指南》

 

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6