华为交换机常用命令

合集下载

华为系列交换机常用命令

华为系列交换机常用命令

华为系列交换机常⽤命令华为系列交换机常⽤命令:dis vlan 显⽰vlanname text 指定当前vlan的名称undo name 取消dis startup 显⽰启动配置⽂件的信息dis user-interface 显⽰⽤户界⾯的相关信息dis web users 显⽰web⽤户的相关信息。

header login 配置登陆验证是显⽰信息header shell[h3c] vlan 2[h3c-vlan2]name test vlandis users 显⽰⽤户undo headerlock 锁住当前⽤户界⾯acl 访问控制列表 acl number inbound/outbound[h3c]user-interface vty 0 4[h3c-vty0-4] acl 2000 inboundshutdown:关闭vlan接⼝undo shutdown 打开vlan接⼝关闭vlan1 接⼝[h3c] interface vlan-interface 1[h3c-vlan-interface] shutdownvlan vlan-id 定义vlanundo valn vlan-iddisplay ip routing-tabledisplay ip routing-table protocol staticdisplay ip routing-table statisticsdisplay ip routing-table verbose 查看路由表的全部详细信息interface vlan-interface vlan-id 进⼊valnmanagement-vlan vlan-id 定义管理vlan号reset ip routing-table statistics protocol all 清除所有路由协议的路由信息.display garp statistics interface GigabitEthernet 1/0/1 显⽰以太⽹端⼝上的garp统计信息display voice vlan status 查看语⾳vlan状态[h3c-GigabitEthernet1/0/1] broadcast-suppression 20 允许接受的最⼤⼴播流量为该端⼝传输能⼒的20%.超出部分丢弃. [h3c-GigabitEthernet1/0/1] broadcast-suppression pps 1000 每秒允许接受的最⼤⼴播数据包为1000传输能⼒的20%.超出部分丢弃.display interface GigabitEthernet1/0/1 查看端⼝信息display brief interface GigabitEthernet1/0/1 查看端⼝简要配置信息display loopback-detection ⽤来测试环路测试是否开启display transceiver-information interface GigabitEthernet1/0/50 显⽰光⼝相关信息duplex auto/full/half[h3c]interface GigabitEthernet1/0/1[h3c-GigabitEthernet1/0/1]duplux auto 设置端⼝双⼯属性为⾃协商port link-type access/hybrid/trunk 默认为accessport trunk permit vlan all 将trunk扣加⼊所有vlan中reset counters interface GigabitEthernet1/0/1 清楚端⼝的统计信息speed auto 10/100/1000display port-security 查看端⼝安全配置信息am user-bind mac-addr 00e0-fc00-5101 ip-addr 10.153.1.2 interface GigabitEthernet1/0/1 端⼝ip绑定display arp 显⽰arpdisplay am user-bind 显⽰端⼝绑定的配置信息display mac-address 显⽰交换机学习到的mac地址display stp 显⽰⽣成树状态与统计信息[h3c-GigabitEthernet1/0/1]stp instance 0 cost 200 设置⽣成树实例0上路径开销为200stp cost 设置当前端⼝在指定⽣成树实例上路径开销。

交换机常用操作指令华为

交换机常用操作指令华为

华为交换机常用指令一、交换机设备登陆及配置:1、设备登陆配置我中心维护汇聚和热点交换机,交换机类型为5300、2300和GPON,交换机使用secure CRT软件登录;交换机使用之前需要刷机,使用secureCRT配置:协议是serial,端口com12,波特流9600,流控制不配置;刷交换机所需要的信息:在3a模式下用户名和密码;snmp为网络管理协议,配置网管所需的指令,固定不变;telnet配置——远程登陆配置信息;登陆汇聚和热点交换机首先93-5交换机核心交换机,登录协议选择ssh登录,登陆其它交换机在93-5上使用telnet远程登陆命令跳转,只能单向;核心交换机登陆用户名:hanxu69309,密码:Hx9309;华为汇聚和热点交换机的登陆用户名和密码都为huaweitest;其他核心交换机的登录地址:交换机型号为9312交换机型号为6500交换机型号为6500交换机型号为8500交换机型号为8500交换机型号为93062、交换机配置思路:➢配置设备名称;➢管理AP所需要配置的信息➢管理交换机配置的信息➢在3a模式下配置,配置以下用户名和密码;配置固定➢snmp为网络管理协议,下面为加入网管所配置的指令,固定不变;➢telnet配置——远程登陆配置信息3、数据准备:➢管理VLAN的ID;➢交换机的管理IP;➢交换机连接其他交换机的接口号;➢验证方式、用户名和密码;二、5300交换机开站指令1、交换机简介5300系列交换机,包括5328和5324等,不能给AP供电;下面介绍的指令为5328,是5300系列的一种,共有28个端口;532853242、开站指令➢配置设备名称;System 78 C-1G3a2A25GC3YB91dhcp enable 0.0.02F-1G0.0.03a2A25GC3YB91 ➢snmp为网络管理协议,下面为加入网管所配置的指令,固定不变;snmp-agent //snmp为网络管理协议snmp-agent local-engineid 800007DB000FE2D45DF46877 //snmp-agent community read SDm0bile acl 2009snmp-agent community read publiccm0snmp-agent community write privatecm0snmp-agent community read SDJN-2008-Wlan-nms acl 2001snmp-agent sys-info version allsnmp-agent target-ho➢telnet配置——远程登陆配置信息user-interface vty 0 4 //vty虚拟线路authentication-mode aaa //认证模式为3aidle-timeout 15 0 //登陆时间return四、华为GPON开站指令1、交换机简介基于GPON技术的设备基本结构与已有的PON类似,也是由局端的OLT光线路终端,用户端的ONT/ONU光网络终端或称作光网络单元,连接前两种设备由单模光纤SM fiber和无源分光器Splitter组成的ODN光分配网络以及网管系统组成;GPONGPON与其他交换机有些许区别,配置思路如下:a)OLT数据配置步骤:1、设备命名2、创建线路模板第一次开局需要配置,后期只需要使用3、创建VLAN,上行口透传VLAN4、进入GPON单板模式下,添加新发现ONU,下发ONU IP地址5、在config模式下透传ONU 业务VLAN、管理VLANb)ONU数据配置:1、创建VLAN2、上行口透传VLAN3、在端口上添加、透传vlan2、开站指令➢设备命名sysname SD_JN_HuaiYinShuCai_MA5680T //设备命名为SD_JN_HuaiYinShuCai_MA5680T➢创建线路模板第一次开局需要配置,后期只需要使用ont-lineprofile gpon profile-id 1 profile-name "line-profile_1" //创建一个线路模板,刚开局的时候做,以后只引用就行;tcont 1 dba-profile-id 8 //tcont模板1绑定速率模板,8表示速率模板为“最大带宽1000M”gem add 0 eth tcont 1 //gem 0号模板绑定tcont模板1,相当于gem 0号模板绑定了速率模板gem mapping 0 0 vlan 680 //gem 绑定ONU管理VLAN,允许0-7,共8个VLANgem mapping 0 1 vlan 7 //gem 绑定AP管理VLANgem mapping 0 2 vlan 1113 //gem 绑定AP 业务VLANcommit //保存➢创建VLAN,上行口透传VLANvlan 7 smart //创建AP管理VLAN 7vlan 654 smart //创建OLT管理VLAN 654vlan 680 smart //创建ONU管理VLAN680vlan 1113 smart //创建AP业务VLAN1113vlan 3000 smart //创建OLT管理VLAN 3000port vlan 7 0/19 0 //上行口0/19 0表示0框19槽0口,上行口透传AP 管理VLAN7port vlan 654 0/19 0 //上行口透传OLT管理VLAN 654port vlan 1113 0/19 0 //上行口透传AP业务VLAN 1113port vlan 3000 0/19 0 //上行口透传OLT管理VLAN 3000➢进入GPON单板模式下,添加新发现ONU,下发ONU IP地址interface gpon 0/1 //进入GPON单板0/1 0表示0框,1表示1槽位port 0 ont-auto-find enable //打开0端口ONU自动发现功能开局时只做一次就可以port 1 ont-auto-find enable //打开1端口ONU自动发现功能开局时只做一次就可以port 2 ont-auto-find enable //打开2端口ONU自动发现功能开局时只做一次就可以port 3 ont-auto-find enable //打开3端口ONU自动发现功能开局时只做一次就可以port 4 ont-auto-find enable //打开4端口ONU自动发现功能开局时只做一次就可以port 5 ont-auto-find enable //打开5端口ONU自动发现功能开局时只做一次就可以port 6 ont-auto-find enable //打开6端口ONU自动发现功能开局时只做一次就可以port 7 ont-auto-find enable //打开7端口ONU自动发现功能开局时只做一次就可以为0,引用线路模板1;配置ONU的物理地址,SN码等同于MAC;ont ipconfig 1 0 static ip-address vlan 680//为1端口ONTID编号为0的ONU下发IP地址为680service-port 0 vlan 680 gpon 0/1/1 ont 0 gemport 0 multi-service user-vlan 680 tag-transform translate //创建一个VLAN680的服务模板,映射到在gpon 0框1槽位1端口ONTID为0的ONUservice-port 1 vlan 7 gpon 0/1/1 ont 0 gemport 0 multi-service user-vlan 7 tag-transform translate //创建一个VLAN 7的服务模板,映射到在gpon 0框1槽位1端口ONTID为0的ONUservice-port 2 vlan 1113 gpon 0/1/1 ont 0 gemport 0 multi-serviceuser-vlan 1113 tag-transform translate //创建一个VLAN 1113的服务模板,映射到在gpon 0框1槽位1端口ONTID为0的ONUinterface vlanif654 //创建VLAN 654接口interface vlanif680 //创建VLAN 680接口ip //配置ONU管理地址interface vlanif3000 //创建VLAN 3000接口meth routing disableip route-static 0.0.0 //配置VLAN 3000默认路由ip route-static 0.0.0return➢ONU数据配置,创建VLAN,上行口透传VLANtelnet //远程登录ONU地址enableconfigswitch language-mode //当前语言模式已切换到本地语种sysname HuaTaiQiChe_MA5626 //给ONU命名为:HuaTaiQiChe_MA5626vlan 7 smart //创建AP管理VLAN 7vlan 680 smart //创建ONU业务VLAN 680vlan 1113 smart //创建AP业务VLAN 1113port vlan 7 0/0 1 //上行口“0/0 1”表示0框0槽位1端口,在0框0槽1端口透传VLAN 7port vlan 680 0/0 1 //在0框0槽1端口透传VLAN 680 port vlan 1113 0/0 1 //在0框0槽1端口透传VLAN 1113➢在端口上添加、透传VLANservice-port 0 vlan 7 eth 0/1/1 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位1端口 VLAN 模式为untaggedservice-port vlan 7 eth 0/1/2 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6//创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位2端口 VLAN 模式为untaggedservice-port vlan 7 eth 0/1/3 multi-service user-vlan untagged rx-cttrONU 0框1槽位3端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/4 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位4端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/5 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位5端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/6 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位6端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/7 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位7端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/8 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位8端口 VLAN模式为untaggedAP的管理VLAN7;service-port vlan 1113 eth 0/1/1 multi-service user-vlan 1113 rx-cttr 6 tx- cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位1端口 VLAN为透传模式;ONU业务VLAN1113service-port vlan 1113 eth 0/1/2 multi-service user-vlan 1113 rx-cttr到在ONU 0框1槽位2端口 VLAN为透传模式service-port vlan 1113 eth 0/1/3 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位3端口 VLAN为透传模式service-port vlan 1113 eth 0/1/4 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位4端口 VLAN为透传模式service-port vlan 1113 eth 0/1/5 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位5端口 VLAN为透传模式service-port vlan 1113 eth 0/1/6 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位6端口 VLAN为透传模式service-port vlan 1113 eth 0/1/7 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位7端口 VLAN为透传模式service-port vlan 1113 eth 0/1/8 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位8端口 VLAN为透传模式Save五、常用指令:System //表示进入配置状态display cu //查看交换机上所有的配置Display interface brief //53、33和23的交换机,显示此交换机的端口状态命令;命令用来查看接口状态和配置的简要信息,包括接口的物理状态、协议状态、接收方向最近一段时间的带宽利用率、发送方向最近一段时间的带宽利用率、接收的错误报文数和发送的错误报文数; display interface gigabitethernet 0/0/1 //查看以太网接GigabitEthernet0/0/1的运行状态;//查看交换机是否通,ping管理地址;Display vlan XX //显示透传VLANxx的端口Undo VLAN 2 //去掉VLANdisplay access-user //命令用来按照指定条件查看在线用户会话连接信息;display alarm urgent //命令用来查看S-switch的告警信息;命令将接口加入隔离组后,可执行本命令查看已经加入到隔离组中的接口信息;汇聚交换机不做隔离,热点交换机做隔离;Display arp //显示交换机学来的地址,包括交换机和AP的,23和24是上行口,其他为下行口;display ip interface brief //表示显示接口与IP相关的摘要信息,包括IP地址、子网掩码、物理链路和协议的Up/Down状态;display mac-address //命令用来查看MAC地址表信息,显示的内容包括目的MAC地址、目的设备所属的VLAN、出接口、表项类型和标签交换路径;display alarm urgent //命令用来查看S-switch的告警信息;不指定可选参数时,该命令将显示所有告警记录信息;int GI1/1/1 //进入某端口;Shutdown //进入后,执行shutdown表示关闭;Undo shutdown开启display cpu-usage //命令用来查看CPU占用率的统计信息和配置信息; display device //命令用来查看S-switch设备的CPU型号、内存容量、Flash存储器容量和各槽位所插部件的信息;不指定可选参数时,该命令将显示S-switch设备的CPU型号、内存容量、Flash存储器容量和所有槽位所插部件的信息;display diagnostic-information //命令用来查看并保存系统当前各模块的诊断信息,以便系统出现故障时,一次性将信息收集全,便于问题定位;display environment //命令用来查看S-switch设备的温度信息; display this interface //命令用来查看当前接口视图的接口状态信息; display reboot-info //命令用来查看设备的复位信息;display schedule reboot //命令用来查看S-switch定时重新启动的设置信息;Reboot //命令用来重新启动S-switch设备;该命令功能与S-switch 关闭电源再开启电源的效果相同;在对S-switch进行远程维护时,不需到现场重新启动S-switch,只需执行本命令即可在远程重新启动S-switch;debugging ip icmp //命令用来打开ICMP的调试开关,如果把ICMP 重定向报文发送开关和ICMP主机不可达报文发送开关关闭,则不发送报文;undo debugging ip icmp //命令用来关闭ICMP连接的调试开关;Debugging //命令用来打开调试信息开关;undo debugging //命令用来关闭调试信息开关;缺省情况下,所有的调试信息开关处于关闭状态;在打开调试信息开关后,S-switch将有可能产生大量的调试信息,从而降低S-switch的工作效率;谨慎使用debugging all命令;display debugging //命令用来查看已经打开的调试信息开关;如果不指定可选参数,本命令将显示所有已经打开的调试信息开关;icmp-reply fast //命令用来使能设备ping快回功能;undo icmp-reply fast //命令用来去使能设备ping快回功能;缺省情况下设备ping快回功能使能;设备开启ping快回功能后,设备对收到的目的地址是自己的ICMP Echo报文做快速应答;ping快回功能使能后,设备不能对ICMP报文进行统计;设备使能ping快回功能后,设备没有收到ping发起端的ARP时也能快速应答ICMP Echo报文,但是不能触发设备学习ping发起端的ARP;设备开启ping快回功能后,设备对收到的目的地址是自己的ICMP Echo报文做快速应答;ping快回功能使能后,设备不能对ICMP报文进行统计;设备使能ping快回功能后,设备没有收到ping发起端的ARP时也能快速应答ICMP Echo报文,但是不能触发设备学习ping发起端的ARP;Ping //命令用来检查IP网络连接及主机是否可达;Tracert //命令用来测试数据包从发送主机到目的地所经过的网关;通过执行此命令所显示的内容,可以检查网络连接是否可达,以及分析网络什么地方发生了故障;tracert命令的执行过程:首先发送一个TTL为1的数据包,因此第一跳发送回一个ICMP错误消息以指明此数据包不能被发送因为TTL超时,之后此数据包被重新发送,TTL为2,同样第二跳返回TTL超时,这个过程不断进行,直至到达目的地;执行这些过程的目的是记录每一个ICMP TTL超时消息的源地址,以提供一个IP数据包到达目的地所经历的路径;当用命令测试发现网络出现故障后,可以用tracert测试网络何处有故障;tracert命令的输出信息包括到达目的地所有网关的IP地址,如果某网关超时,则输出“”;。

华为交换机常用配置命令

华为交换机常用配置命令

端口划入Vlan前,必须设置为access模式端口批量加入Vlan[huawei]port-group yewu[huawei-port-group-yewu]group-member g0/0/4 to g0/0/6 [huawei-port-group-yewu]port link-type access[huawei-port-group-yewu]port default vlan 100密码配置[Quidway]user-interface con 0[Quidway-ui-console0]set authentication passwordTelnet配置[huawei]int vlan 1[Quidway-Vlanif1]ip address 192.168.1.100 255.255.255.0 设置管理地址[huawei]aaa 进入aaa配置模式[huawei-aaa]local-user admin password 设置admin密码[huawei-aaa]local-user admin privilege level 3 然后设置登陆权限[huawei-aaa]local-user admin service-type telnet 设置登录类型[huawei]user-interface vty 0 4 进入认证配置模式[huawei-ui-vty0-4]authentication-mode aaa 设置aaa认证恢复交换机出厂配置<huawei>reset saved-configuration 檫除旧的配置文件<huawei>reboot 交换机重启xt startup:, Continue?[Y/N]:n 此处选N忘记console密码,恢复交换机出厂配置设备重启时按Ctrl+B进入BOOT MENU之后,默认密码是:****************第一步、选择7;第二步、Y;第三步、选择1。

华为交换机常用命令S5700

华为交换机常用命令S5700

常用命令:1、关闭telnet服务Undo telnet server enable2、关闭NDP邻居发现协议Undo ndp enable3、关闭DHCP服务Undo dhcp enable4、查看当前生效的配置信息:display current-configuration5、对于某些正在生效的配置参数,如果与缺省参数相同,则不显示。

查看当前视图下生效的配置信息:display this6、对于某些正在生效的配置参数,如果与缺省参数相同,则不显示。

如果还需要显示当前视图下未被修改的缺省配置,可以执行命令display this include-default进行查看。

7、VLAN创建vlan 100 创建一组VLAN:vlan batch 10-20 批量删除VLAN:un vlan batch 10-208、查看vlan列表:dis vlan9、端口管理:int g0/0/110、端口模式配置:port link-type access11、端口加入VLAN:port default vlan 1012、关闭信息提示服务un info en undo info enable13、user-bind static ip-address 10.0.85.10 mac-address 5489-9833-3520 interface GigabitEthernet0/0/23配置端口IP\MAC地址绑定NTP时钟服务器配置查看NTP各种状态1、查看本地设备的NTP会话信息。

display ntp-service sessions2、查看本地设备NTP会话的详细信息display ntp-service sessions verbose3、查看从本地设备到参考时钟源的路径display ntp-service trace4、查看NTP报文的统计信息display ntp-service statistics packet5、查看最新的10条时钟不同步原因display ntp-service event clock-unsync查看最新的10条时钟不同步原因设置时间服务器地址查看NTP状态<S2300>dis clock2018-06-11 09:24:59MondayTime Zone(cst) : UTC+08:00<S2300>dis ntp-service statusclock status: unsynchronizedclock stratum: 16reference clock ID: nonenominal frequency: 60.0002 Hzactual frequency: 60.0002 Hzclock precision: 2^17clock offset: 0.0000 msroot delay: 0.00 msroot dispersion: 2.85 mspeer dispersion: 0.00 msreference time: 00:00:00.000 UTC Jan 1 1900(00000000.00000000)查看ntp服务会话<S2300>dis ntp-service sessionssource reference stra reach poll now offset delay disper******************************************************************************** [12345]10.0.10.176.79.67.7613776438m-0.00.0note: 1 source(master),2 source(peer),3 selected,4 candidate,5 configured,6 vpn-instance修改接口的链路类型接口的链路类型总共有4种,分别为:Access、Trunk、Hybrid、Dot1q-tunnel。

华为交换机常见命令

华为交换机常见命令

一、清空配置:<HUAWEI> reset saved-configuration(清楚下次启动时使用的配置文件信息)然后重启设备,重启设备室提示保存信息,选择“NO”。

<HUAWEI> reset saved-configurationWarning: The action will delete thesaved configuration in the device.The configuration will be erased to reconfigure. Continue? [Y/N]:yWarning: Now clearing the configuration inthe device.Info: Succeeded in clearing the configuration in the device.<HUAWEI> rebootInfo: The system is now comparing the configuration, pleasewait.Warning: The configuration has been modified, and it will be saved tothe next startup saved-configuration file flash:/vrpcfg.zip. Continue?[Y/N]:n //此处请选择“N”Info: If want to reboot with saving diagnosticinformation, input 'N' and then execute 'reboot save diagnostic-information'.System will reboot! Continue?[Y/N]:y二、通过STelnet/Telnet登录交换机设置新的Console口登录密码# 以登录用户界面的认证方式为密码认证,密码为Huawei@123为例,配置如下。

华为交换机常使用命令

华为交换机常使用命令

;进入端口模式
;进入端口模
;配置端口工作
;配置端口工作速率 ;配置端口流控 ;配置端口平接
;设置端口工作模式 ;当前端口加入到 VLAN
;设 trunk 允许的 VLAN ;设置 trunk 端口的 PVID
;激活端口 ;
;返回
[Quidway]vlan 3 [Quidway-vlan3]port ethernet 0/1 [Quidway-vlan3]port e0/1 写方式 [Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 [Quidway-vlan3]port e0/1 to e0/4
[Quidway-serial0]undo shutdown
[Quidway]link-protocol hdlc
hdlc 协议
[Quidway]user-interface vty 0 4
[Quidway-ui-vty0-4]authentication-mode password
[Quidway-ui-vty0-4]set authentication-mode password simple 222
;设置生成树, ;设置
;设置为根或根的 ;设置交换机
[Quidway]link-aggregation e0/1 to e0/4 ingress|both [Quidway]undo link-aggregation e0/1|all 为通道号
; 端口的聚合 ; 始端口
[SwitchA-vlanx]isolate-user-vlan enable
;删除 vlan 的 pvid
[Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged ;设置无标识的 vlan

华为交换机常用配置命令

华为交换机常用配置命令

华为交换机基本配置命令一、单交换机VLAN划分命令命令解释system 进入系统视图system-view 进入系统视图quit 退到系统视图undo vlan 20 删除vlan 20sysname 交换机命名disp vlan 显示vlanvlan 20 创建vlan(也可进入vlan 20)port e1/0/1 to e1/0/5 把端口1-5放入VLAN 20 中disp vlan 20 显示vlan里的端口20int e1/0/24 进入端口24port access vlan 20 把当前端口放入vlan 20undo port e1/0/10 表示删除当前VLAN端口10disp curr 显示当前配置二、配置交换机支持TELNETsystem 进入系统视图sysname 交换机命名int vlan 1 进入VLAN 1ip address 192.168.3.100 255.255.255.0 配置IP地址user-int vty 0 4 进入虚拟终端authentication-mode password (aut password) 设置口令模式set authentication password simple 222 (set aut pass sim 222) 设置口令user privilege level 3(use priv lev 3) 配置用户级别disp current-configuration (disp cur) 查看当前配置disp ip int 查看交换机VLAN IP配置删除配置必须退到用户模式reset saved-configuration(reset saved) 删除配置reboot 重启交换机三、跨交换机VLAN的通讯在sw1上:vlan 10 建立VLAN 10int e1/0/5 进入端口5port access vlan 10 把端口5加入vlan 10vlan 20 建立VLAN 20int e1/0/15 进入端口15port access vlan 20 把端口15加入VLAN 20int e1/0/24 进入端口24port link-type trunk 把24端口设为TRUNK端口port trunk permit vlan all 同上在SW2上:vlan 10 建立VLAN 10int e1/0/20 进入端口20port access vlan 10 把端口20放入VLAN 10int e1/0/24 进入端口24port link-type trunk 把24端口设为TRUNK端口port trunk permit vlan all (port trunk permit vlan 10 只能为vlan 10使用)24端口为所有VLAN使用disp int e1/0/24 查看端口24是否为TRUNKundo port trunk permit vlan all 删除该句四、路由的配置命令system 进入系统模式sysname 命名int e1/0 进入端口ip address 192.168.3.100 255.255.255.0 设置IPundo shutdown 打开端口disp ip int e1/0 查看IP接口情况disp ip int brief 查看IP接口情况user-int vty 0 4 进入口令模式authentication-mode password(auth pass) 进入口令模式set authentication password simple 222 37 设置口令user privilege level 3 进入3级特权save 保存配置reset saved-configuration 删除配置(用户模式下运行)undo shutdown 配置远程登陆密码int e1/4ip route 192.168.3.0(目标网段) 255.255.255.0 192.168.12.1(下一跳:下一路由器的接口)静态路由ip route 0.0.0.0 0.0.0.0 192.168.12.1 默认路由disp ip rout 显示路由列表sw1(三层交换机):int vlan 10 创建虚拟接口VLAN 10ip address 192.168.10.254 255.255.255.0 设置虚拟接口VLAN 10的地址int vlan 20 创建虚拟接口VLAN 20ip address 192.168.20.254 255.255.255.0 设置虚拟接口IP VLAN 20的地址注意:vlan 10里的计算机的网关设为 192.168.10.254vlan 20里的计算机的网关设为 192.168.20.254[S9306-GigabitEthernet2/0/42]dis this#interface GigabitEthernet2/0/42 原先的为trunk,port link-type trunkport trunk allow-pass vlan 2 to 4094Duplex {auto/half/full}Speed {auto/10/100/1000}#interface GigabitEthernet2/0/42 现在改为accessundo port trunk allow-pass vlan allport trunk allow-pass vlan 1port link-type accessport default vlan 10Stp enableStp priority 4096Stp root {primary/secondary}华为路由器交换机配置命令:路由器命令[Quidway]displayversion;显示版本信息[Quidway]displaycurrent-configuration;显示当前配置[Quidway]displayinterfaces;显示接口信息[Quidway]displayiproute;显示路由信息[Quidway]sysnameaabbcc;更改主机名[Quidway]superpasswrod123456;设置口令[Quidway]interfaceserial0;进入接口[Quidway-serial0]ipaddress;配置端口IP地址[Quidway-serial0]undoshutdown;激活端口配置ospf[S9300-A] router id 1.1.1.1[S9300-A] ospf 100[S9300-A-ospf-100] area 0[S9300-A-ospf-100-area-0.0.0.0] network 192.168.0.0 0.0.0.255 [S9300-A-ospf-100-area-0.0.0.0] quit[S9300-A-ospf-1] area 1[S9300-A-ospf-100-area-0.0.0.1] network 192.168.1.0 0.0.0.255 [S9300-A-ospf-100-area-0.0.0.1] quit[S9300-A-ospf-1] quit。

华为交换机常用命令及解释

华为交换机常用命令及解释

一、基本配置1、视图system-view 认也只属于VLAN1.[quidway-ethernet0/1]port hybrid vlan {vlan-id} {tagged|untagged} [h3c-mst-region]instance 3 valn 11 to 20[h3c-mst-region]revision-level 1 //设置MST域的MSTP修订级别,即版本号[h3c-mst-region]active region-configuration //手动激活MST域的配置[h3c]stp instance 2 root primary //设置各MSTI实例的根。

当实例号为0时,指定此交换机为CIST的根,而不是MSTI的根。

也可以用优先级来设置。

[h3c]stp instance 2 root secondary //设置各实例的备份根[h3c]undo stp instance 2 root //取消当前交换机的根或备份根交换机的资格以下设置端口开销[h3c]stp interface gig1/0/1 instance 1 cost 2000 //设置端口在实例中的开销,以选举实例的根端口或指定端口。

[h3c]interface gig1/0/1[h3c-gigabitethernet1/0/1] stp instance 1 cost 2000 //这种方法和上面的结果一样,只是先进入端口,再设定。

以下设置端口优先级[h3c]stp interface gig1/0/1 instance 1 port priority 16 //设置端口优先级[h3c]interface gig1/0/1[h3c-gigabitethernet1/0/1] stp instance 1 port priority 16//同样是设置端口优先级以下设置国边缘端口[h3c]stp interface gig1/0/1 edged-port enable //设置为边缘端口[h3c]stp interface gig1/0/1 edged-port disable //设置为非边缘端口[h3c]undo stp edged-port gig1/0/1 edged-port //恢复为缺省的非边缘端口[h3c]interface gig1/0/1 //方法二,先进入端口,再配置[h3c-gigabitethernet1/0/1]stp edged-port enable[h3c-gigabitethernet1/0/1]stp edged-port disable[h3c-gigabitethernet1/0/1]undo stp edged-port[h3c]stp mode {stp|mstp} //配置MSTP的工作模式。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

.
'.
华为交换机常用命令

1.打开远程登录命令
操作步骤
步骤 1 在 PC 端和交换机端分别和网络连接。
步骤 2 在 Target 交换机端配置登录用户参数。
# 配置登录地址
system-view
[Quidway] vlan 10
[Quidway-vlan10] quit
[Quidway] interface gigabitethernet 0/0/1
[Quidway-GigabitEthernet0/0/1] port link-type hybrid
[Quidway-GigabitEthernet0/0/1] port hybrid untagged vlan 10
[Quidway-GigabitEthernet0/0/1] quit
[Quidway]interface vlanif 10
[Quidway-vlanif10] ip address 202.38.160.92 255.255.0.0
[Quidway-vlanif10] quit
# 配置登录验证方式
[Quidway] aaa
[Quidway-aaa] local-user huawei password cipher hello
[Quidway-aaa] local-user huawei service-type telnet
[Quidway-aaa] local-user huawei level 3
[Quidway-aaa] quit
[Quidway] user-interface vty 0 4
[Quidway-ui-vty0-4] authentication-mode aaa

2.执行命令 description description,配置接口描述。
3.
1. 执行命令 system-view,进入系统视图。
2. 执行命令 interface interface-type interface-number,进入指定接口的接口视图。
3. 执行命令 shutdown,关闭接口。
4.
请在 S5700 上进行以下配置。
1. 执行命令 system-view,进入系统视图。
2. 执行命令 interface interface-type interface-number,进入指定接口的接口视图。
3. 执行命令 undo shutdown,启动接口。

5.
缺省情况下,S5700 支持的命令级别为 0 ~ 3 级,依次分别为:访问级、监控级、配置 级
和管理级。 如果用户需要在设备端定义更多级别,实现权限的更精细管理,可以采用命令
行级别扩 展功能,将命令级别由 0 ~ 3 级批量提升到 0 ~ 15 级。
.
'.
6.重命名
执行命令 sysname host-name,设置设备名称。
7.
CON 适用于从 Console 接口进 行本地登录
VTY 适用于通过 Telnet 或 SSH 方式进行本地或远程登录
8.
表 5-3 登录用户的验证方式
不验证 登录用户不需要输入用户名和密码,就可以直接登录 S5700。存在 很大的安全隐患。
Password 验证 登录用户只需要输入密码,无需用户名,可以获得一定的安全性。
AAA 验证 登录用户需要提供用户名和密码,由 S5700 根据本地配置的用户信 息进行验证。
进一步改善了安全性,提供了基于用户的安全管理, 适用于通过 Console 接口和 Telnet 登
录的用户。
9.
.

'.
10.
执行命令 user-interface maximum-vty number,配置可以同时登录到交换机的 VTY 类 型用
户界面的最大个数。
例如:当前允许最多 5 个 VTY 用户同时在线,现在配置为允许 15 个 VTY 用户同时在 线,
那么 VTY 用户接口 5 ~ 14 就需要使用 authentication-mode 和 set authentication
password 命令配置验证方式和密码,配置如下:
system-view
[Quidway] user-interface maximum-vty 15
[Quidway] user-interface vty 5 14
[Quidway-ui-vty5-14] authentication-mode password
[Quidway-ui-vty5-14] set authentication password cipher Huawei

相关文档
最新文档