交换机常用操作指令-华为
- 格式:doc
- 大小:790.50 KB
- 文档页数:15
华为路由器交换机常用命令一、设备管理命令1.登录管理命令- ssh [ip地质] -p [端口号]:通过SSH协议登录设备。
- telnet [ip地质]:通过Telnet协议登录设备。
- logout:退出设备。
2.用户管理命令- display current-configuration:显示当前设备配置信息。
- save:保存当前配置。
- undo save:取消保存的配置。
- super:切换到超级用户模式。
- user-interface console 0:配置控制台终端的参数。
- user-interface vty 0 4:配置远程登录终端的参数。
3.设备操作命令- reboot:重启设备。
- reset saved-configuration:恢复出厂配置。
- display version:显示设备的硬件和软件版本信息。
- display device:显示设备的基本信息。
- display interface[接口名称]:显示指定接口信息。
- display ip routing-table:显示IP路由表信息。
二、网络配置命令1.IP配置命令- interface [接口名称]:进入指定接口。
- ip address [IP地质] [子网掩码]:配置接口IP地质。
- undo ip address:取消接口IP地质配置。
- ip route-static [目标网络] [子网掩码] [下一跳地质]:配置静态路由。
- undo ip route-static [目标网络] [子网掩码] [下一跳地质]:取消静态路由配置。
2.VLAN配置命令- vlan [VLAN ID]:创建指定VLAN。
- quit:退出VLAN配置模式。
- interface vlan [VLAN ID]:进入指定VLAN接口。
- ip address [IP地质] [子网掩码]:为VLAN接口配置IP地质。
华为交换机基本配置命令详解1、配置文件相关命令[Quidway]display current-configuration 显示当前生效的配置[Quidway]display saved-configuration显示flash中配置文件,即下次上电启动时所用的配置文件reset saved-configuration 檫除旧的配置文件reboot 交换机重启display version 显示系统版本信息2、基本配置[Quidway]super password 修改特权用户密码[Quidway]sysname 交换机命名[Quidway]interface ethernet 1/0/1 进入接口视图[Quidway]interface vlan 1进入接口视图[Quidway-Vlan-interfacex]ip address 10.1.1.11 255.255.0.0配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1静态路由=网关3、telnet配置[Quidway]user-interface vty 0 4 进入虚拟终端[S3026-ui-vty0-4]authentication-mode password 设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple xmws123设置口令[S3026-ui-vty0-4]user privilege level 3 用户级别4、端口配置[Quidway-Ethernet1/0/1]duplex {half|full|auto} 配置端口工作状态[Quidway-Ethernet1/0/1]speed {10|100|auto} 配置端口工作速率[Quidway-Ethernet1/0/1]flow-control 配置端口流控[Quidway-Ethernet1/0/1]mdi {across|auto|normal} 配置端口平接扭接[Quidway-Ethernet1/0/1]port link-type {trunk|access|hybrid} 设置端口工作模式[Quidway-Ethernet1/0/1]undo shutdown 激活端口[Quidway-Ethernet1/0/2]quit 退出系统视图5、链路聚合配置[DeviceA] link-aggregation group 1 mode manual 创建手工聚合组1[Qw_A] interface ethernet 1/0/1 将以太网端口Ethernet1/0/1加入聚合组1 [Qw_A-Ethernet1/0/1] port link-aggregation group 1[Qw_A-Ethernet1/0/1] interface ethernet 1/0/2 将以太网端口Ethernet1/0/1加入聚合组1[Qw_A-Ethernet1/0/2] port link-aggregation group 1[Qw_A] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建t unnel业务环回组。
华为交换机日常维护查看命令
1.dis device 用来查看设备信息
2.dis interface 用来查看接口信息
3.dis version 用来查看版本信息
4.slot-id 用来查看某一单板、电子标签的信息
5.dis env 用来查看设备的温度
6.dis cpu 用来查看cpu的信息
7.dis memory 用来查看内存的信息
8.dis interface 用来查看接口的信息
9.terminal monitor 终端信息显示功能
10.terminal debug 使终端现实调试信息
11.temperature threshold 设置温度的告警值
12. display diagnostic-information 显示诊断信息
13. display ip routing-table 显示路由信息
14.display current-configuration 显示系统当前配置
15. display saved-configuration 显示系统保存配置
16.display vlan 显示VLAN信息
17.display stp 显示生成树信息
18.display arp 显示ARP信息表
19.display mac-address 显示MAC地址表
20.display log 显示系统日志
21.display clock 显示系统时钟
22. display ip int brief 查看三层接口汇总信息。
1.进入管理界面:system-view2.设置用户登录时需要进行口令验证,且验证口令为huawei。
[Quidway] user-interface 0[Quidway-ui0] authentication-mode password[Quidway-ui0] set authentication password simple huawei3. 设置从用户界面登录后可以访问的命令级别: user privilege level level恢复从用户界面登录后可以访问的命令级别为缺省级别: undo user privilege level4.系统IP配置:a.创建并进入管理VLAN接口视图:interface vlan-interface vlan-id删除管理VLAN :undo interface vlan-interface vlan-idb.配置管理VLAN接口IP地址:ip address ip-address net-mast删除管理VLAN接口IP地址:undo ip address [ip-address net-mast]5. 进入Ethernet0/1以太网端口视图。
[Quidway] interface ethernet0/16. 配置端口Ethernet0/1为Trunk端口,并允许2、6到50、100等VLAN通过。
[Quidway-Ethernet0/1] port link-type trunk[Quidway-Ethernet0/1] port trunk permit vlan 2 6 to 50 100创建VLAN 100。
[Quidway] vlan 100配置端口Ethernet0/1的缺省VLAN ID为100。
[Quidway-Ethernet0/1] port trunk pvid vlan 1007. 创建VLAN并进入VLAN视图: vlan vlan_id删除已创建的VLAN: undo vlan{ vlan_id [ to vlan_id ] | all }8. 为指定的VLAN增加以太网端口: port interface_list删除指定的VLAN的某些以太网端口: undo port interface_list创建VLAN2并进入其视图。
一、清空配置:<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为例,配置如下。
一、基本配置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、视图system-view //用户视图[quidway]interface ethernet 0/1 //系统视图[quidway-ethernet0/1]//接口视图2、密码及基本参数配置(1) console口登录配置system-view[quidway]user-interface aux 0[quidway-aux0]authentication-mode{none|password|scheme} //设置登录的验证方法。
none是不要验证,password是密码验证,scheme是服务器验证。
[quidway-aux0]set authentication password {cipher|simple} 123456 //当上面的模式为paaword时,设置验证的密码。
simple是明文密码。
[quidway-aux0]user privilege level 2 //设置从AUX登录后可以访问的命令级别为2级,默认是1级。
[quidway-aux0]speed 19200 //设置console口使用的传输速率[quidway-aux0]screen-length 30 //设置一屏显示30行命令[quidway-aux0]history-command max-size 20 //设置历史命令缓冲区最多存放20条命令[quidway-aux0]idle-timeout 6 //设置超时时间为6分钟(2)telnet 登录system-view[quidway]user-interface vty 0 4[quidway-aux0]authentication-mode{none|password|scheme} //设置登录的验证方法。
none是不要验证,password是密码验证,scheme是服务器验证。
[quidway-aux0]set authentication password {cipher|simple} 123456 //当上面的模式为paaword时,设置验证的密码。
华为交换机配置常用命令一、配置软件和硬件1、配置(Console)电缆连接配置电缆是一根8芯屏蔽电缆,一端是压接的RJ-45连接器,插入交换机的Console口里;另一端则同时带有一个DB-9(孔)和DB-25(孔)连接器2、配置软件及设置使用系统自带的“超级终端”,运行“hypertrm”程序,设置终端参数参数要求:波特率为9600,数据位为8,奇偶校验为无,停止位为1,流量控制为无,选择终端仿真为VT100。
二、常用命令1、用户模式:交换机启动后在控制台直接按回车就进入用户模式(远程管理telnet 交换机ip时需要口令)。
--帮助quit ――退出当前模式返回上一级<switchone>ping ip-address --测试网络连通性<switchone>telnet ip-address --从交换机登陆其它设备<switchone>super --从用户模式进入特权模式2、特权模式:进入特权模式一般需要口令,可以防止非法登陆交换机<switchone>display current --显示当前运行的配置<switchone>save --保存当前运行的配置<switchone>reboot --重启交换机<switchone>display mac ――显示mac地址表<switchone>display inteface ethernet 0/1 ――查看以太网口状态<switchone>system-view --从特权模式进入全局模式3、全局模式:更改配置a.进入以太网口配置模式及相关配置[switchone]interface ethernet 0/1[switchone-Ethernet0/1]shutdown/undo shutdown 关闭/打开接口[switchone-Ethernet0/1]port link-type access/trunk 接口类型设为untagged端口(默认)/tagged端口(用于上行口和级联口)access端口发出和接收的帧不带vlan标记,即untagged端口trunk端口发出和接收的帧一般要带vlan标记,即tagged端口设为tagged口后,还要做以下操作:[switchone-Ethernet0/1]port trunk permit vlan 225 to 250这条命令是允许有vlan标记225到250的帧上传b.进入vlan配置模式(为了便于操作,不用在接口模式下配置access,而在vlan模式下进行相关操作)[switchone]vlan 225[switchone-vlan225] port Ethernet 1/1 将ethernet 1/1加入vlan225c.设置super口令[switchone]super password simple 2403h 特权口令为2403h三、标准配置:802.1Q标准的VLAN(与汇聚交换机、BAS直连的交换机),#vlan 1#vlan 225#vlan 226#vlan 227#vlan 228#vlan 229#vlan 230#vlan 231#vlan 232#vlan 233#vlan 234#vlan 235#vlan 236#vlan 237#vlan 238#vlan 239#vlan 240#vlan 241#vlan 242#vlan 243#vlan 244#vlan 245#vlan 246#vlan 247#vlan 248#vlan 249#vlan 250#interface Vlan-interface250ip address 11.22.33.250 255.255.255.0 #interface Ethernet0/1port access vlan 225#interface Ethernet0/2port access vlan 226#interface Ethernet0/3port access vlan 227#interface Ethernet0/4port access vlan 228#interface Ethernet0/5port access vlan 229#interface Ethernet0/6port access vlan 230#interface Ethernet0/7port access vlan 231#interface Ethernet0/8port access vlan 232# interface Ethernet0/9port access vlan 233#interface Ethernet0/10 port access vlan 234#interface Ethernet0/11 port access vlan 235#interface Ethernet0/12 port access vlan 236#interface Ethernet0/13 port access vlan 237#interface Ethernet0/14 port access vlan 238#interface Ethernet0/15 port access vlan 239#interface Ethernet0/16 port access vlan 240#interface Ethernet0/17 port access vlan 241#interface Ethernet0/18 port access vlan 242#interface Ethernet0/19 port access vlan 243# interface Ethernet0/20 description 30-1-fenghuo port access vlan 244#interface Ethernet0/21 description 1-4-huawei port access vlan 245#interface Ethernet0/22 description 5-2-fenghuo port access vlan 246#interface Ethernet0/23 description 6-1-port access vlan 247#interface Ethernet0/24 description 40-1-port access vlan 248#interface Ethernet0/25port access vlan 249 #interface Ethernet1/1port link-type trunkport trunk permit vlan 225 to 250。
华为交换机常用指令一、交换机设备登陆及配置:1、设备登陆配置我中心维护汇聚和热点交换机,交换机类型为5300、2300和GPON,交换机使用secure CRT软件登录。
交换机使用之前需要刷机,使用secureCRT配置:协议是serial,端口com12,波特流9600,流控制不配置。
刷交换机所需要的信息:在3a模式下用户名和密码;snmp 为网络管理协议,配置网管所需的指令,固定不变; telnet配置——远程登陆配置信息。
登陆汇聚和热点交换机首先93-5交换机(核心交换机),登录协议选择ssh登录,登陆其它交换机在93-5上使用telnet(远程登陆)命令跳转,只能单向。
核心交换机登陆用户名:hanxu69309,密码:Hx#9309。
华为汇聚和热点交换机的登陆用户名和密码都为huaweitest。
其他核心交换机的登录地址:93-5 211.137.192.8 (交换机型号为9312)65-1 120.192.23.36 (交换机型号为6500)65-2 120.192.23.37 (交换机型号为6500)85-1 120.192.22.129 (交换机型号为8500)85-2 120.192.22.130 (交换机型号为8500)93-1 211.137.192.1 (交换机型号为9306)2、交换机配置思路:➢配置设备名称。
➢管理AP所需要配置的信息➢管理交换机配置的信息➢在3a模式下配置,配置以下用户名和密码。
(配置固定)➢snmp为网络管理协议,下面为加入网管所配置的指令,固定不变。
➢telnet配置——远程登陆配置信息3、数据准备:➢管理VLAN的ID。
➢交换机的管理IP。
➢交换机连接其他交换机的接口号。
➢验证方式、用户名和密码。
二、5300交换机开站指令1、交换机简介5300系列交换机,包括5328和5324等,不能给AP供电。
下面介绍的指令为5328,是5300系列的一种,共有28个端口。
532853242、开站指令➢配置设备名称。
System //进入配置模式sysname SDJN-WLAN-SW-ZRSJGC-1-S5328 //给交换机命名vlan 1 2001 2101 2126 to 2127 2218 2501 //创建vlanbpdu-tunnel reserved03 group-mac 0100-5e99-9999 //交换机支持sim认证使用,网维提供的。
➢管理AP所需要配置的信息,以端口1为例interface Vlanif1 //进入VLAN 1接口配置模式ip address 172.18.48.1 255.255.255.192 //配置vlan1的地址(AP管理地址),上述地址是华为规划分配的。
dhcp select interface //在vlan1接口下开启dhcpdhcp server option 43 hex 11 04 78 C0 16 14 //配置option 43属性(43为协议,固定) AC指向,AC地址(AP设备商告知)➢管理交换机配置的信息Vlan2501 //创建交换机的管理VLANinterface Vlanif2501 //配置管理vlan,ip address 172.18.0.2 255.255.255.240 //配置管理地址#interface GigabitEthernet0/0/1 //进入交换机互联端口description TO-[SDJN-WLAN-SW-ZRSJA7-1-S2326]-GE0/0/1-1G //增加端口描述,对端口描述。
port default vlan 1 //端口pvid为vlan1 port trunk allow-pass vlan 1 2001 2126 to 2127 2501 //在端口透传管理vlan 和业务vlan如果端口不是trunk模式,可以使用port link trunk更改为trunk模式bpdu-tunnel enable //交换机支持sim认证使用stp disable //关闭stp(和budp-tunnel冲突)➢在3a模式下配置,配置以下用户名和密码。
(下面的配置固定)aaa //配置用户名和密码authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user huaweitest password cipher 6=&6UK3FFI!^;G`86SMT)local-user huaweitest level 3local-user huaweitest ftp-directory flash:local-user huaweitest service-type telnetlocal-user liuwei135******** password cipher B9%*G/VMY1+Q=^Q`MAF4<1!!local-user liuwei135******** level 3local-user liuwei135******** ftp-directory flash:local-user liuwei135******** service-type telnetlocal-user taonaiyong135******** password cipher N%>`3>8V$XWQ=^Q`MAF4<1!!local-user taonaiyong135******** level 3local-user taonaiyong135******** ftp-directory flash:local-user taonaiyong135******** service-type telnetlocal-user wangzhenlin135******** password cipher (@!A(K7ENC/Q=^Q`MAF4<1!!local-user wangzhenlin135******** level 3local-user wangzhenlin135******** ftp-directory flash:local-user wangzhenlin135******** service-type telnetlocal-user zhanjunyun135******** password cipher ]QII2A/F0[CQ=^Q`MAF4<1!!local-user zhanjunyun135******** level 3local-user zhanjunyun135******** ftp-directory flash:local-user zhanjunyun135******** service-type telnetlocal-user zhoulei138******** password cipher VI$A25G"C>5B,.\#C3YB91!!local-user zhoulei138******** level 3local-user zhoulei138******** ftp-directory flash:local-user zhoulei138******** service-type telnet#dhcp enable //全局开启dhcp功能ip route-static 0.0.0.0 0.0.0.0 172.18.0.1 //默认路由,下一跳为核心交换机上的互联地址,即93的管理地址。
➢snmp为网络管理协议,下面为加入网管所配置的指令,固定不变。
snmp-agent //snmp为网络管理协议snmp-agent local-engineid 800007DB000FE2D45DF46877snmp-agent community read SDm0bile acl 2009snmp-agent community read SDJN-2008-Wlan-nms acl 2001snmp-agent sys-info version allsnmp-agent target-host trap address udp-domain 211.137.179.36 params securityname SDJN-2008-Wlan-nmssnmp-agent target-host trap address udp-domain 211.137.179.36 params securityname SDm0bilesnmp-agent target-host trap address udp-domain 211.137.179.40 params securityname SDm0bile➢telnet配置——远程登陆配置信息user-interface con 0user-interface vty 0 4 //远程登录开放0-4五条虚拟线路authentication-mode aaa //远程登录认证模式为aaaidle-timeout 15 0三、2300交换机开站指令1、交换机简介2300系列交换机,现网中为2309和2326交换机,2309有9个端口,2326有26个端口,可以给AP供电。
230923262、开站指令➢配置设备名称。
sysname SDJN-WLAN-SWJYYZ1#2F3-1-S2309 //给交换机命名vlan batch 12141 to 2143 2145 2557 //创建vlan,VLAN范围1-4094。
l2protocol-tunnel user-defined-protocol dot1x protocol-mac 0180-c200-0003 group-mac 0100-0000-0000 //交换机支持sim认证使用➢管理AP所需要配置的信息,以端口1为例interface Ethernet0/0/1 //进入端口配置模式,下面开始配置AP端口port link-type trunk //端口模式为trunkport trunk allow-pass vlan 2141 to 2143 2145 //在端口透传AP管理vlan和业务vlan l2protocol-tunnel user-defined-protocol dot1x enable //交换机支持sim认证使用port-isolate enable group 1 //二层交换机端口隔离➢管理交换机配置的信息interface Vlanif2557 //配置管理vlan地址ip address 172.18.2.117 255.255.255.240interface GigabitEthernet0/0/1description TO-[SDJN-WLAN-SW-JYYZ-1-5928FI]-GE1/1-1G //增加端口描述,描述链接到的设备,可能是汇聚,也可能是热点(热点为级联)。