热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

交换机华为命令行配置视图

用户视图(查看运行状态或其他参数)系统视图(配置设备的系统参数)system-viewEntersystemview,returnuservi

用户视图(查看运行状态或其他参数)
<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 2 2021 21: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 2 2021 21: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 0 4
#
return配置cipher密码(加密密码)
[switch2-ui-console0]set authentication password cipher 123456
[switch2-ui-console0]
Dec 2 2021 22: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 0 4
#
return更改自动退出超时(配置屏幕睡眠) 单位:分钟 24*60&#61;1440
[switch-ui-console0]idle-timeout 1440
[switch-ui-console0]
Dec 2 2021 22: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 2 2021 22: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 2 2021 22: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 2 2021 22:40:01-08:00 switch %%01IFNET/4/BOARD_DISABLE(l)[55]:Board 0 has b
een unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFPDT/4/IF_STATE(l)[56]:GigabitEthernet0/0
/1 has turned into DOWN state.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[57]:Interface Gigabi
tEthernet0/0/1 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFPDT/4/IF_STATE(l)[58]:GigabitEthernet0/0
/2 has turned into DOWN state.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[59]:Interface Gigabi
tEthernet0/0/2 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_STATE(l)[60]:Interface Vlanif1
has turned into DOWN state.
Dec 2 2021 22:40:01-08:00 switch %%01IFPDT/4/IF_STATE(l)[61]:GigabitEthernet0/0
/3 has turned into DOWN state.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[62]:Interface Gigabi
tEthernet0/0/3 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[63]:Interface Gigabi
tEthernet0/0/4 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[64]:Interface Gigabi
tEthernet0/0/5 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[65]:Interface Gigabi
tEthernet0/0/6 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[66]:Interface Gigabi
tEthernet0/0/7 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[67]:Interface Gigabi
tEthernet0/0/8 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[68]:Interface Gigabi
tEthernet0/0/9 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[69]:Interface Gigabi
tEthernet0/0/10 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[70]:Interface Gigabi
tEthernet0/0/11 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[71]:Interface Gigabi
tEthernet0/0/12 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[72]:Interface Gigabi
tEthernet0/0/13 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[73]:Interface Gigabi
tEthernet0/0/14 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[74]:Interface Gigabi
tEthernet0/0/15 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[75]:Interface Gigabi
tEthernet0/0/16 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[76]:Interface Gigabi
tEthernet0/0/17 has been unavailable.
Dec 2 2021 22:40:01-08:00 switch %%01IFNET/4/IF_DISABLE(l)[77]:Interface Gigabi
tEthernet0/0/18 has been unavailable.
Dec 2 2021 22: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 2 2021 22: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 file for 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 2 2021 22:53:51-08:00 switch2 %%01PHY/1/PHY(l)[1]: GigabitEthernet0/0/2:change status to down
Dec 2 2021 22: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 2 2021 22:58:01-08:00 switch2 %%01PHY/1/PHY(l)[2]: GigabitEthernet0/0/2:change status to up
Dec 2 2021 22: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.

推荐阅读
  • 本文介绍了C#中生成随机数的三种方法,并分析了其中存在的问题。首先介绍了使用Random类生成随机数的默认方法,但在高并发情况下可能会出现重复的情况。接着通过循环生成了一系列随机数,进一步突显了这个问题。文章指出,随机数生成在任何编程语言中都是必备的功能,但Random类生成的随机数并不可靠。最后,提出了需要寻找其他可靠的随机数生成方法的建议。 ... [详细]
  • 本文讨论了编写可保护的代码的重要性,包括提高代码的可读性、可调试性和直观性。同时介绍了优化代码的方法,如代码格式化、解释函数和提炼函数等。还提到了一些常见的坏代码味道,如不规范的命名、重复代码、过长的函数和参数列表等。最后,介绍了如何处理数据泥团和进行函数重构,以提高代码质量和可维护性。 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了如何在方法参数中指定一个对象的协议,以及如何调用符合该协议的方法。以一个具体的示例说明了如何在方法参数中指定一个UIView子类对象,并且该对象需要符合PixelUI协议,同时方法需要能够访问该对象的属性。 ... [详细]
  • 开发笔记:实验7的文件读写操作
    本文介绍了使用C++的ofstream和ifstream类进行文件读写操作的方法,包括创建文件、写入文件和读取文件的过程。同时还介绍了如何判断文件是否成功打开和关闭文件的方法。通过本文的学习,读者可以了解如何在C++中进行文件读写操作。 ... [详细]
  • 本文介绍了Windows操作系统的版本及其特点,包括Windows 7系统的6个版本:Starter、Home Basic、Home Premium、Professional、Enterprise、Ultimate。Windows操作系统是微软公司研发的一套操作系统,具有人机操作性优异、支持的应用软件较多、对硬件支持良好等优点。Windows 7 Starter是功能最少的版本,缺乏Aero特效功能,没有64位支持,最初设计不能同时运行三个以上应用程序。 ... [详细]
  • 配置IPv4静态路由实现企业网内不同网段用户互访
    本文介绍了通过配置IPv4静态路由实现企业网内不同网段用户互访的方法。首先需要配置接口的链路层协议参数和IP地址,使相邻节点网络层可达。然后按照静态路由组网图的操作步骤,配置静态路由。这样任意两台主机之间都能够互通。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • 本文介绍了OpenStack的逻辑概念以及其构成简介,包括了软件开源项目、基础设施资源管理平台、三大核心组件等内容。同时还介绍了Horizon(UI模块)等相关信息。 ... [详细]
  • Android工程师面试准备及设计模式使用场景
    本文介绍了Android工程师面试准备的经验,包括面试流程和重点准备内容。同时,还介绍了建造者模式的使用场景,以及在Android开发中的具体应用。 ... [详细]
  • 本文介绍了使用哈夫曼树实现文件压缩和解压的方法。首先对数据结构课程设计中的代码进行了分析,包括使用时间调用、常量定义和统计文件中各个字符时相关的结构体。然后讨论了哈夫曼树的实现原理和算法。最后介绍了文件压缩和解压的具体步骤,包括字符统计、构建哈夫曼树、生成编码表、编码和解码过程。通过实例演示了文件压缩和解压的效果。本文的内容对于理解哈夫曼树的实现原理和应用具有一定的参考价值。 ... [详细]
  • 本文详细解析了vlan接口类型和划分的相关知识,包括access、trunk和hybrid接口类型的特点和功能,以及它们在数据包发送和接收过程中的处理方式。同时介绍了pvid的作用和使用方法,以及trunk接口在发送数据包时的处理规则。最后,还介绍了如何使所有vlan生效的方法。 ... [详细]
  • 本文讨论了微软的STL容器类是否线程安全。根据MSDN的回答,STL容器类包括vector、deque、list、queue、stack、priority_queue、valarray、map、hash_map、multimap、hash_multimap、set、hash_set、multiset、hash_multiset、basic_string和bitset。对于单个对象来说,多个线程同时读取是安全的。但如果一个线程正在写入一个对象,那么所有的读写操作都需要进行同步。 ... [详细]
  • 微软评估和规划(MAP)的工具包介绍及应用实验手册
    本文介绍了微软评估和规划(MAP)的工具包,该工具包是一个无代理工具,旨在简化和精简通过网络范围内的自动发现和评估IT基础设施在多个方案规划进程。工具包支持库存和使用用于SQL Server和Windows Server迁移评估,以及评估服务器的信息最广泛使用微软的技术。此外,工具包还提供了服务器虚拟化方案,以帮助识别未被充分利用的资源和硬件需要成功巩固服务器使用微软的Hyper - V技术规格。 ... [详细]
author-avatar
流浪汉中的小男人
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有