07
2024
04
21:23:02

华为VRP系统基本操作



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png


一、组网需求:


Router是一台全新无配置的路由器,PC通过串口线缆连接到Router的Console Port,需要对Router进行一些初始化操作。

二、eNSP实验视频:

 

https://www.bilibili.com/video/BV1Cf4y187LR


三、配置思路

1.完成设备命名、路由器接口IP地址等基础配置


2.保存设备配置


3.重启设备


四、配置步骤

步骤 1 通过Console方式登录到Router的CLI


略。


步骤 2 查看设备基本信息 


# 查看设备版本信息 


<Huawei>display version


Huawei Versatile Routing Platform Software


VRP (R) software, Version 5.160 (AR651C V300R019C00SPC100)


Copyright (C) 2011-2016 HUAWEI TECH CO., LTD


Huawei AR651C Router uptime is 0 week, 0 day, 0 hour, 53 minutes


BKP 0 version information:


1. PCB      Version  : AR01BAK2C VER.B


2. If Supporting PoE : No


3. Board    Type     : AR651C


4. MPU Slot Quantity : 1


5. LPU Slot Quantity : 1


步骤 3 完成设备基本配置 


# 修改Router的名字为Datacom-Router


<Huawei>system-view


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


[Huawei]


此时设备已经从用户视图进入到了系统视图。


 [Huawei]sysname Datacom-Router


[Datacom-Router]


此时设备名称已经修改为Datacom-router。


华为设备提供丰富的功能,相应的也提供了多样的配置和查询命令。为便于用户使用这些命令,华为设备按功能分类将命令分别注册在不同的命令行视图下。配置某一功能时,需首先进入对应的命令行视图,然后执行相应的命令进行配置。


 


# 进入接口配置接口的IP地址


[Datacom-Router]inter                           //输入TAB补全命令


[Datacom-Router]interface                         //“interface”是唯一可选的关键字


[Datacom-Router]interface g                        //输入TAB补全命令


[Datacom-Router]interface GigabitEthernet           //“GigabitEthernet”是唯一可选的关键字


[Datacom-Router]interface GigabitEthernet 0/0/1      //手动补全命令


输入命令的某个关键字的前几个字母,按下<tab>键,可以显示出完整的关键字,前提是这几个字母可以唯一标示出该关键字,否则,连续按下<tab>键,可出现不同的关键字,用户可以从中选择所需要的关键字。如:


“inter”+TAB,因为当前视图下以inter开头的命令只有interface,则命令直接补全为interface,连续按多次TAB也不会变化。


[Datacom-Router-GigabitEthernet0/0/1]  


此时已经进入到了接口GigabitEthernet0/0/1的视图


[Datacom-Router-GigabitEthernet0/0/1]i?


  icmp   <Group> icmp command group


  igmp   Specify parameters for IGMP


  ip     <Group> ip command group


  ipsec  Specify IPSec(IP Security) configuration information


  ipv6   <Group> ipv6 command group


  ISIS   Configure interface parameters for ISIS


当用户输入命令时,如果只记得此命令关键字的开头一个或几个字符,可以使用部分帮助获取以该字符串开头的所有关键字的提示。如:


在GigabitEthernet0/0/1接口视图下,输入“i”+“?”,则会显示当前视图下所有“i”开头的命令的可选项,此时可以用TAB键补全,也可以手动补全。其中,“icmp”,“igmp”等为关键字,“<Group> icmp command group”, “Specify parameters for IGMP”等为对关键字的描述。


[Datacom-Router-GigabitEthernet0/0/1]ip ?


  accounting          <Group> accounting command group


  address             <Group> address command group


  binding             Enable binding of an interface with a VPN instance


  fast-forwarding     Enable fast forwarding


  forward-broadcast   Specify IP directed broadcast information


  netstream           IP netstream feature


  verify              IP verify


键入一条命令的部分关键字,后接以空格分隔的“?”,如果该位置为关键字,则列出全部关键字及其简单描述。如:


“ip” +空格+“?”,则会显示所有以ip为关键字的命令与对应的解释


[Datacom-Router-GigabitEthernet0/0/1]ip address ?


  IP_ADDR<X.X.X.X>   IP address


  bootp-alloc        IP address allocated by BOOTP


  dhcp-alloc         IP address allocated by DHCP


  unnumbered         Share an address with another interface 


[Datacom-Router-GigabitEthernet0/0/1]ip address 192.168.1.1 ?


  INTEGER<0-32>      Length of IP address mask


  IP_ADDR<X.X.X.X>   IP address mask


[Datacom-Router-GigabitEthernet0/0/1]ip address 192.168.1.1 24 ?


  sub    Indicate a subordinate address


  <cr>   Please press ENTER to execute command


“<cr>”表示该位置没有关键字或参数,直接键入回车即可执行。


[Datacom-Router-GigabitEthernet0/0/1]dis this


#


interface GigabitEthernet0/0/1


 ip address 192.168.1.1 255.255.255.0


#


display this命令用来查看当前视图的运行配置。对于某些正在生效的配置参数,如果与缺省工作参数相同,则不显示;对于某些参数,虽然用户已经配置,但如果这些参数所在的命令没有成功提交,则不予显示。此命令常用于检查配置。


设备支持不完整关键字输入,即在当前视图下,当输入的字符能够匹配唯一的关键字时,可以不必输入完整的关键字。该功能提供了一种快捷的输入方式,有助于提高操作效率。如:


在接口下使用“dis this”,虽然没有输入完整的命令,但由于当前视图下匹配“dis this”的命令只有“display this”,所有命令可以正常执行。类似的还有“dis cu”、“d cu”等同于“display current-configuration”。


[Datacom-Router-GigabitEthernet0/0/1]quit


quit命令用来从当前视图退回到较低级别视图,如果是用户视图,则退出系统。


 


# 此时发现接口IP地址配置错误,需要将该地址配置到interface GigabitEthernet 0/0/2接口


[Datacom-Router]interface GigabitEthernet 0/0/1


[Datacom-Router-GigabitEthernet0/0/1]undo ip address


需要先删除GigabitEthernet0/0/1的IP地址配置,否则会产生地址冲突无法配置。


在命令前加undo关键字,即为undo命令行。undo命令行一般用来恢复缺省情况、禁用某个功能或者删除某项配置。几乎每条配置命令都有对应的undo命令行。


[Datacom-Router]interface GigabitEthernet 0/0/2


[Datacom-Router-GigabitEthernet0/0/2]ip address 192.168.1.1 24


[Datacom-Router-GigabitEthernet0/0/2]quit


 


# 查看设备当前配置


[Datacom-Router]display current-configuration


[V200R003C00]


#


 sysname Datacom-Router


#


 snmp-agent local-engineid 800007DB03000000000000


 snmp-agent


#


 clock timezone China-Standard-Time minus 08:00:00


#


portal local-server load portalpage.zip


#


 drop illegal-mac alarm


#


 set cpu-usage threshold 80 restore 75


#


aaa


 authentication-scheme default


 authorization-scheme default


 accounting-scheme default


 domain default


 domain default_admin


 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$


 local-user admin service-type http


#


  ---- More ----


 


当执行某一命令后,如果显示的信息超过一屏时,系统会自动暂停输出信息,以方便用户查看。此时在显示信息的最底部会出现“---- More ----”的字样,此时可以通过:


1.键入<Ctrl+C>或<Ctrl+Z>,停止显示或命令执行。


2.键入空格键,继续显示下一屏信息。


3.键入回车键,继续显示下一行信息。


 


步骤 4 保存设备当前配置


# 返回到用户视图


[Datacom-Router]quit


<Datacom-Router>


除了通过quit命令外,也可以通过:


1.return命令,该命令可在任何视图下直接返回到用户视图。


2.ctrl+z快捷键,该快捷键可在任何视图下直接返回到用户视图。


 


# 保存配置


<Datacom-Router>save


  The current configuration will be written to the device.


  Are you sure to continue? (y/n)[n]:y                          //需要输入y来确认继续


  It will take several minutes to save configuration file, please wait.......


  Configuration file had been saved successfully


  Note: The configuration file will take effect after being activated


  当前配置已经成功保存!


用户通过命令行可以修改设备的当前配置,而这些配置未被保存的,如果要使当前配置在系统下次重启时仍然有效,在重启设备前,需要将当前配置保存到配置文件中。可以通过save直接保存到默认路径并覆盖原有的配置文件,也可以通过命令“save configuration-file”用来保存当前配置信息到存储设备中的指定文件中。该命令通常情况下不影响系统当前的启动配置文件


 


# 比较当前配置与下一次启动所使用的配置


<Datacom-Router>compare configuration


 The current configuration is the same as the next startup configuration file.


当前的配置与下次启动的配置文件内容一致


 


步骤 5 操作设备的文件系统


# 查看当前目录下的文件列表


<Datacom-Router>dir


Directory of flash:/


 


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


    0  -rw-    126,538,240   Jul 04 2016 17:57:22    ar651c- v300r019c00Sspc100.cc


    1  -rw-         22,622   Feb 20 2020 10:35:18    mon_file.txt


    2  -rw-            737   Feb 20 2020 10:38:36    vrpcfg.zip          


    3  drw-              -   Jul 04 2016 18:51:04    CPM_ENCRYPTED_FOLDER


    4  -rw-            783   Jul 10 2018 14:46:16    default_local.cer


    5  -rw-              0   Sep 11 2017 00:00:54    brdxpon_snmp_cfg.efs


    6  drw-              -   Sep 11 2017 00:01:22    update


    7  drw-              -   Sep 11 2017 00:01:48    shelldir


    8  drw-              -   Sep 21 2019 17:14:24    localuser


    9  drw-              -   Sep 15 2017 04:35:52    dhcp


   10  -rw-            509   Feb 20 2020 10:38:40    private-data.txt


   11  -rw-          2,686   Dec 19 2019 15:05:18    mon_lpu_file.txt


   12  -rw-          3,072   Dec 18 2019 18:15:54    Boot_LogFile


 


510,484 KB total available (386,456 KB free)


vrpcfg.zip:配置文件。配置文件必须以“.cfg”或“.zip”作为扩展名。


ar651c- v300r019c00Sspc100.cc:系统软件。系统软件必须以“.cc”作为扩展名。


 


# 将当前的配置保存同时命名为test.cfg


<Datacom-Router>save test.cfg


 Are you sure to save the configuration to test.cfg? (y/n)[n]:y            //需要输入y来确认


  It will take several minutes to save configuration file, please wait.......


  Configuration file had been saved successfully


  Note: The configuration file will take effect after being activated


 


# 再次查看当前目录下的文件列表


<Datacom-Router>dir


Directory of flash:/


 


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


    0  -rw-    126,538,240   Jul 04 2016 17:57:22    ar651c- v300r019c00Sspc100.cc


    1  -rw-         22,622   Feb 20 2020 10:35:18    mon_file.txt


    2  -rw-            737   Feb 20 2020 10:38:36    vrpcfg.zip


    3  drw-              -   Jul 04 2016 18:51:04    CPM_ENCRYPTED_FOLDER


    4  -rw-            783   Jul 10 2018 14:46:16    default_local.cer


    5  -rw-              0   Sep 11 2017 00:00:54    brdxpon_snmp_cfg.efs


    6  drw-              -   Sep 11 2017 00:01:22    update


    7  drw-              -   Sep 11 2017 00:01:48    shelldir


    8  drw-              -   Sep 21 2019 17:14:24    localuser


    9  drw-              -   Sep 15 2017 04:35:52    dhcp


   10  -rw-          1,404   Feb 20 2020 11:55:17    test.cfg


   11  -rw-            509   Feb 20 2020 11:55:18    private-data.txt


   12  -rw-          2,686   Dec 19 2019 15:05:18    mon_lpu_file.txt


   13  -rw-          3,072   Dec 18 2019 18:15:54    Boot_LogFile


 


510,484 KB total available (386,452 KB free)


配置文件保存成功!


 


# 把该文件设置为设备下一次启动所使用的配置文件 


<Datacom-Router>startup saved-configuration test.cfg


This operation will take several minutes, please wait.....


Info: Succeeded in setting the file for booting system


 


# 查看下一次启动所用的文件


<Datacom-Router>display startup


MainBoard:


  Startup system software:              flash:/ ar651c- v300r019c00Sspc100.cc


  Next startup system software:              flash:/ ar651c- v300r019c00Sspc100.cc


  Backup system software for next startup:    null


  Startup saved-configuration file:           flash:/vrpcfg.zip


  Next startup saved-configuration file:      flash:/test.cfg


  Startup license file:                       null


  Next startup license file:                  null


  Startup patch package:                    null


  Next startup patch package:                null


  Startup voice-files:                       null


  Next startup voice-files:               null


display startup命令用来查看设备本次及下次启动相关的系统软件、备份系统软件、配置文件、License文件、补丁文件以及语音文件等。


 


# 清空配置文件


<Datacom-Router>reset saved-configuration


This will delete the configuration in the flash memory.


The device configuratio


ns will be erased to reconfigure.


Are you sure? (y/n)[n]:y                         //需要输入y来确认


 Clear the configuration in the device successfully.


 


步骤 6 重启设备 


<Datacom-Router>reboot


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


System will reboot! Continue ? [y/n]:y                         //需要输入y来确认继续


Info: system is rebooting ,please wait...


系统开始重启


<Datacom-Router>


设备重启完成



本文链接:https://hqyman.cn/post/5655.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: