VRP初始基本配置
01.查看系统信息
执行 display version 命令,查看路由器的软件版本与硬件信息。
[Huawei]display version
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.130 (AR2200 V200R003C00)
Copyright (C) 2011-2012 HUAWEI TECH CO., LTD
Huawei AR2220 Router uptime is 0 week, 0 day, 0 hour, 17 minutes
BKP 0 version information:
1. PCB Version : AR01BAK2A VER.NC
2. If Supporting PoE : No
3. Board Type : AR2220
4. MPU Slot Quantity : 1
5. LPU Slot Quantity : 6
MPU 0(Master) : uptime is 0 week, 0 day, 0 hour, 17 minutes
MPU version information :
1. PCB Version : AR01SRU2A VER.A
2. MAB Version : 0
3. Board Type : AR2220
4. BootROM Version : 0
命令回显信息中包含了VRP版本,设备型号和启动时间等信息。
02.修改系统时间
VRP系统会自动保存时间,但如果时间不正确,可以在用户视图下执行 clock timezone 命令和 clock datetime 命令修改系统时间。
<Huawei>clock timezone Local add 08:00:00
<Huawei>clock datetime 12:00:00 2019-07-01
可以修改Local字段为当前地区的时区名称。如果当前时区位于UTC+0时区的西部,需要把add字段修改为minus。
执行 display clock 命令查看生效的新系统时间。
<Huawei>display clock
2019-07-05 11:39:46
Friday
Time Zone(BJ) : UTC+08:00
03.修改设备名称
配置设备时,为了方便区分,往往给设备定义不懂的名称。
使用 system-view 命令进入系统视图。进入之后使用 sysname 命令配置设备名称。
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]
04.配置登陆信息
配置登陆标语信息来进行提示或进行登陆警告。执行 header shell information 命令配置登陆信息。
[R1]header shell information "Welcome to the Huawei certification lab."
退出路由器命令界面,再重新登陆命令界面,查看登陆信息是否已经修改。
[R1]quit
<R1>quit
Configuration console exit, please press any key to log on
Welcome to the Huawei certification lab.
<R1>
05.配置 Console 口参数
默认情况下,通过Console口登陆无密码,任何人都可以直接连接到设备,进行配置。
为避免由此带来的风险,可以将Console接口登陆方式配置为密码认证方式,密码为密文形式的“Huawei@123”
空闲时间,指的是经过莫有任何操作的一定时间后,会自动退出该配置界面,再次登陆会根据系统要求,提示输入密码进行验证。
设置空闲超时时间为20分钟,默认为10分钟。
[R1]user-interface console 0
[R1-ui-console0]authentication-mode password
[R1-ui-console0]set authentication password cipher
Warning:The "password" authentication mode is not secure,and it is strongly recommended to use "aaa"
authentication mode.
Enter Password(<8-128>)
Confirm Password:
[R1-ui-console0]idle-timeout 20 0
执行 display this 命令查看配置结果。
[R1-ui-console0]display this
[V200R003C00]
#
user-interface con 0
authentication-mode password
set authentication password cipher %$%$=m/o=A0B2L$e~aFio:**,1O%c-SO,>z8!J:ZEv6B@M"&1O(,%$%$
idle-timeout 20 0
user-interface vty 0 4
authentication-mode aaa
user-interface vty 16 20
#
return
退出系统,并使用新配置的密码登录系统。需要注意的是,在路由器第一次初始化启动时,也需要配置密码。
[R1-ui-console0]return
<R1>quit
Configuration console exit, please press any key to log on
Login authentication
Password:
Welcome to the Huawei certification lab.
<R1>
06.配置接口IP地址和描述信息
配置R1上GigabitEthernet 0/0/0接口的IP地址。使用点分十进制格式(如255.255.255.0)或根据子网掩码前缀长度配置子网掩码。
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.10.2.1 30
[R1-GigabitEthernet0/0/0]description This interface connects to R3-G0/0/0
在当前接口视图下,执行 display this 命令查看配置结果。
[R1-GigabitEthernet0/0/0]display this
[V200R003C00]
#
interface GigabitEthernet0/0/0
description This interface connects to R3-G0/0/0
ip address 10.10.2.1 255.255.255.252
#
return
执行 display interface 命令查看接口信息
[R1]display interface GigabitEthernet 0/0/0
GigabitEthernet0/0/0 current state : UP
Line protocol current state : UP
Last line protocol up time : 2019-07-05 10:57:11 UTC-08:00
Description:This interface connects to R3-G0/0/0
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.10.2.1/30
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fcaa-4851
Last physical up time : 2019-07-05 10:57:11 UTC-08:00
Last physical down time : 2019-07-05 10:57:03 UTC-08:00
Current system time: 2019-07-05 14:09:42+08:00
Port Mode: FORCE COPPER
Speed : 1000, Loopback: NONE
Duplex: FULL, Negotiation: ENABLE
Mdi : AUTO
Last 300 seconds input rate 0 bits/sec, 0 packets/sec
Last 300 seconds output rate 0 bits/sec, 0 packets/sec
Input peak rate 352 bits/sec,Record time: 2019-07-05 10:57:49
Output peak rate 352 bits/sec,Record time: 2019-07-05 10:57:49
Input: 14 packets, 882 bytes
Unicast: 9, Multicast: 0
Broadcast: 5, Jumbo: 0
Discard: 0, Total Error: 0
CRC: 0, Giants: 0
Jabbers: 0, Throttles: 0
Runts: 0, Symbols: 0
Ignoreds: 0, Frames: 0
Output: 15 packets, 956 bytes
Unicast: 8, Multicast: 0
Broadcast: 7, Jumbo: 0
Discard: 0, Total Error: 0
Collisions: 0, ExcessiveCollisions: 0
Late Collisions: 0, Deferreds: 0
Input bandwidth utilization threshold : 100.00%
Output bandwidth utilization threshold: 100.00%
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
从命令回显信息中可以看到,接口的物理状态与协议状态均为Up,表示对应的物理层与数据链路层均可用
配置完成后,通过执行ping命令测试R1和R3之间的连通性。
<R1>ping 10.10.2.2
PING 10.10.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.10.2.2: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 10.10.2.2: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.10.2.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.10.2.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.10.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 10.10.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/30/70 ms
<R1>
07.查看当前设备上存储的文件列表
在用户视图下执行 dir 命令,查看当前目录下的文件列表。
<R1>dir
Directory of flash:/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 drw- - Jul 05 2019 02:57:04 dhcp
1 -rw- 121,802 May 26 2014 09:20:58 portalpage.zip
2 -rw- 2,263 Jul 05 2019 02:56:59 statemach.efs
3 -rw- 828,482 May 26 2014 09:20:58 sslvpn.zip
4 -rw- 690 Jul 05 2019 02:56:56 vrpcfg.zip
1,090,732 KB total (784,460 KB free)
08.管理配置文件
执行 display saved-configuration 命令查看保存的配置文件。
<R1>display saved-configuration
There is no correct configuration file in FLASH
系统中没有已保存的配置文件。在用户视图下执行 save 命令保存当前配置文件。
<R1>save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]: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
重新执行 display saved-configuration 命令查看已保存的配置信息。
<R1>display saved-configuration
[V200R003C00]
#
sysname R1
header shell information "Welcome to the Huawei certification lab."
#
board add 0/1 1SA
board add 0/2 1SA
......output omit......
执行 display current-configuration 命令查看当前配置信息。
<R1>display current-configuration
[V200R003C00]
#
sysname R1
header shell information "Welcome to the Huawei certification lab."
#
board add 0/1 1SA
board add 0/2 1SA
board add 0/3 2FE
......output omit......
一台路由器可以存储多个配置文件。执行 display startup 命令查看下次启动时使用的配置文件。
<R1>display startup
MainBoard:
Startup system software: flash:/AR2200E-v200R007C00SPC600.cc
Next startup system software: flash:/AR2200E-V200R007C00SPC600.cc
Backup system software for next startup: null
Startup saved-configuration file: flash:/vrpcfg.zip
Next startup saved-configuration file: flash:/vrpcfg.zip
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
删除闪存中的配置文件。
<R1>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
Clear the configuration in the device successfully.
09.重启设备
执行 reboot 命令重启路由器。
<R1>reboot
Info: The system is comparing the configuration, please wait.
Warning: All the configuration will be saved to the next startup configuration. Continue ? [y/n]:n
System will reboot! Continue ? [y/n]:y
Info: system is rebooting ,please wait...
系统提示是否保存当前配置,可以根据实验要求决定是否保存当前配置。如果无法确定是否保存,则不保存当前配置。