用户视图(查看运行状态或其他参数) <Huawei>系统视图(配置设备的系统参数) <Huawei>system-view Enter system view, return user view with Ctrl&#43;Z. [Huawei]接口视图(配置接口参数) [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]协议视图(配置xx协议)返回上一视图 [Huawei-GigabitEthernet0/0/1]quit [Huawei]quit <Huawei>直接返回用户视图 <Huawei>system-view Enter system view, return user view with Ctrl&#43;Z. [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]return <Huawei>命令提示:输入一部分在后面输入? <Huawei>sy?system-view <Huawei>sy查看VRP系统版本 <Huawei>display version Huawei Versatile Routing Platform Software VRP (R) software, Version 5.110(S5700 V200R001C00) Copyright (c)2000-2011 HUAWEI TECH CO., LTDQuidway S5700-28C-HI Routing Switch uptime is 0 week, 0 day, 0 hour, 38 minutes <Huawei>更改名称(在系统视图下) [Huawei]sysname s1 [s1]配置登录simple密码(后续在登录时,密码看不见,输完直接按enter就好了) 这里的simple不是说密码内容简单,而是显示的简单,以明文的方式显示出来 [Huawei]user-interface console 0 [Huawei-ui-console0]set authentication password simple 123456 [Huawei-ui-console0] Dec 2202121:47:01-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5 .25.191.3.1 configurations have been changed. The current change number is 4, th e change loop count is 0, and the maximum number of records is 4095. [Huawei-ui-console0]authentication-mode password [Huawei-ui-console0] Dec 2202121:48:22-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5 .25.191.3.1 configurations have been changed. The current change number is 5, th e change loop count is 0, and the maximum number of records is 4095.查看当前设备的配置信息(当看到--More--时,一直按enter即可看完全部) <Huawei>display current-configuration # sysname Huawei # cluster enable ntdp enable ndp enable # drop illegal-mac alarm # diffserv domain default # drop-profile default # aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type http # interface Vlanif1 # interface MEth0/0/1 # interface GigabitEthernet0/0/1 # interface GigabitEthernet0/0/2 # interface GigabitEthernet0/0/3 # interface GigabitEthernet0/0/4 # interface GigabitEthernet0/0/5 # interface GigabitEthernet0/0/6 # interface GigabitEthernet0/0/7 # interface GigabitEthernet0/0/8 # interface GigabitEthernet0/0/9 # interface GigabitEthernet0/0/10 # interface GigabitEthernet0/0/11 # interface GigabitEthernet0/0/12 # interface GigabitEthernet0/0/13 # interface GigabitEthernet0/0/14 # interface GigabitEthernet0/0/15 # interface GigabitEthernet0/0/16 # interface GigabitEthernet0/0/17 # interface GigabitEthernet0/0/18 # interface GigabitEthernet0/0/19 # interface GigabitEthernet0/0/20 # interface GigabitEthernet0/0/21 # interface GigabitEthernet0/0/22 # interface GigabitEthernet0/0/23 # interface GigabitEthernet0/0/24 # interface NULL0 # user-interface con 0authentication-mode passwordset authentication password simple 123456 user-interface vty 04 # return配置cipher密码(加密密码) [switch2-ui-console0]set authentication password cipher 123456 [switch2-ui-console0] Dec 2202122:08:34-08:00 switch2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011. 5.25.191.3.1 configurations have been changed. The current change number is 5, t he change loop count is 0, and the maximum number of records is 4095.此时查看密码的显示 <switch2>display current-configuration # sysname switch2 # cluster enable ntdp enable ndp enable # drop illegal-mac alarm # diffserv domain default # drop-profile default # aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type http # interface Vlanif1 # interface MEth0/0/1 # interface GigabitEthernet0/0/1 # interface GigabitEthernet0/0/2 # interface GigabitEthernet0/0/3 # interface GigabitEthernet0/0/4 # interface GigabitEthernet0/0/5 # interface GigabitEthernet0/0/6 # interface GigabitEthernet0/0/7 # interface GigabitEthernet0/0/8 # interface GigabitEthernet0/0/9 # interface GigabitEthernet0/0/10 # interface GigabitEthernet0/0/11 # interface GigabitEthernet0/0/12 # interface GigabitEthernet0/0/13 # interface GigabitEthernet0/0/14 # interface GigabitEthernet0/0/15 # interface GigabitEthernet0/0/16 # interface GigabitEthernet0/0/17 # interface GigabitEthernet0/0/18 # interface GigabitEthernet0/0/19 # interface GigabitEthernet0/0/20 # interface GigabitEthernet0/0/21 # interface GigabitEthernet0/0/22 # interface GigabitEthernet0/0/23 # interface GigabitEthernet0/0/24 # interface NULL0 # user-interface con 0authentication-mode passwordset authentication password cipher w-:8&#43;fEoLQ9P4p;tsqP&#43;(RN# user-interface vty 04 # return更改自动退出超时(配置屏幕睡眠) 单位:分钟 24*60&#61;1440 [switch-ui-console0]idle-timeout 1440 [switch-ui-console0] Dec 2202122:20:32-08:00 switch DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5 .25.191.3.1 configurations have been changed. The current change number is 7, th e change loop count is 0, and the maximum number of records is 4095.save命令 如果不save,则在停止该交换机(或停电)之后再重启,之前配置的东西都无效 所以在配置完东西之后,应该在用户视图save [Huawei]sysname switch [switch]return <switch>save The current configuration will be written to the device. Are you sure to continue?[Y/N]y Info: Please input the file name ( *.cfg, *.zip )[vrpcfg.zip]: Dec 2202122:32:03-08:00 switch %%01CFM/4/SAVE(l)[54]:The user chose Y when de ciding whether to save the configuration to the device. Now saving the current configuration to the slot 0. Save the configuration successfully. <switch>重启 <switch>reboot Info: The system is now comparing the configuration, please wait. Info: If want to reboot with saving diagnostic information, input &#39;N&#39; and then e xecute &#39;reboot save diagnostic-information&#39;. System will reboot! Continue?[Y/N]:y Dec 2202122:40:01-08:00 switch %%01CMD/4/REBOOT(l)[54]:The user chose Y when deciding whether to reboot the system. (Task&#61;co0, Ip&#61;**, User&#61;**) <switch> Dec 2202122:40:01-08:00 switch %%01IFNET/4/BOARD_DISABLE(l)[55]:Board 0 has b een unavailable. Dec 2202122:40:01-08:00 switch %%01IFPDT/4/IF_STATE(l)[56]:GigabitEthernet0/0 /1 has turned into DOWN state. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[57]:Interface Gigabi tEthernet0/0/1 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFPDT/4/IF_STATE(l)[58]:GigabitEthernet0/0 /2 has turned into DOWN state. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[59]:Interface Gigabi tEthernet0/0/2 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_STATE(l)[60]:Interface Vlanif1 has turned into DOWN state. Dec 2202122:40:01-08:00 switch %%01IFPDT/4/IF_STATE(l)[61]:GigabitEthernet0/0 /3 has turned into DOWN state. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[62]:Interface Gigabi tEthernet0/0/3 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[63]:Interface Gigabi tEthernet0/0/4 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[64]:Interface Gigabi tEthernet0/0/5 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[65]:Interface Gigabi tEthernet0/0/6 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[66]:Interface Gigabi tEthernet0/0/7 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[67]:Interface Gigabi tEthernet0/0/8 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[68]:Interface Gigabi tEthernet0/0/9 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[69]:Interface Gigabi tEthernet0/0/10 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[70]:Interface Gigabi tEthernet0/0/11 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[71]:Interface Gigabi tEthernet0/0/12 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[72]:Interface Gigabi tEthernet0/0/13 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[73]:Interface Gigabi tEthernet0/0/14 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[74]:Interface Gigabi tEthernet0/0/15 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[75]:Interface Gigabi tEthernet0/0/16 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[76]:Interface Gigabi tEthernet0/0/17 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[77]:Interface Gigabi tEthernet0/0/18 has been unavailable. Dec 2202122:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[78]:Interface Gigabi tEthernet0/0/19 has been unavailable.恢复出厂默认(重启后生效) 第一次选y表示确定要恢复出厂设置 第二次选n表示不保存配置 第三次选y表示确定要重启 <switch>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 Warning: Now clearing the configuration in the device. Dec 2202122:43:45-08:00 switch %%01CFM/4/RST_CFG(l)[0]:The user chose Y when deciding whether to reset the saved configuration. Info: Succeeded in clearing the configuration in the device. <switch>reboo <switch>reboot Info: The system is now comparing the configuration, please wait. Warning: All the configuration will be saved to the configuration filefor the n ext startup:, Continue?[Y/N]:n Info: If want to reboot with saving diagnostic information, input &#39;N&#39; and then e xecute &#39;reboot save diagnostic-information&#39;. System will reboot! Continue?[Y/N]:y关闭接口,禁用某一台主机,不让它与其他主机通信 [switch2]interface GigabitEthernet 0/0/2 [switch2-GigabitEthernet0/0/2]shu [switch2-GigabitEthernet0/0/2]shutdown [switch2-GigabitEthernet0/0/2] Dec 2202122:53:51-08:00 switch2 %%01PHY/1/PHY(l)[1]: GigabitEthernet0/0/2:change status to down Dec 2202122:53:55-08:00 switch2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011. 5.25.191.3.1 configurations have been changed. The current change number is 7, t he change loop count is 0, and the maximum number of records is 4095.激活接口 [switch2-GigabitEthernet0/0/2]undo shutdown [switch2-GigabitEthernet0/0/2] Dec 2202122:58:01-08:00 switch2 %%01PHY/1/PHY(l)[2]: GigabitEthernet0/0/2:change status to up Dec 2202122:58:05-08:00 switch2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011. 5.25.191.3.1 configurations have been changed. The current change number is 8, t he change loop count is 0, and the maximum number of records is 4095.