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

合集下载

华为交换机配置命令大全

华为交换机配置命令大全

华为交换机配置命令大全华为交换机是一种高性能、高可靠的数据通信设备,广泛应用于各种网络环境中。

为了更好地使用华为交换机,我们需要了解一些基本的配置命令。

本文将为大家详细介绍华为交换机的配置命令大全,帮助大家更好地了解和使用华为交换机。

1. 登录华为交换机。

首先,我们需要登录华为交换机进行配置。

一般来说,我们可以通过串口、Telnet或SSH方式登录交换机。

以SSH方式登录为例,我们可以使用以下命令:```shell。

ssh -l username 192.168.1.1。

```。

其中,username为登录用户名,192.168.1.1为交换机的IP地址。

登录成功后,我们需要输入密码进行验证。

2. 查看交换机当前配置。

在登录成功后,我们可以使用以下命令查看交换机的当前配置信息:```shell。

display current-configuration。

```。

这条命令可以显示出交换机当前的全部配置信息,包括接口配置、VLAN配置、路由配置等。

3. 配置交换机接口。

接下来,我们可以对交换机的接口进行配置。

比如,我们可以通过以下命令配置一个VLAN接口:```shell。

interface Vlanif1。

ip address 192.168.1.1 255.255.255.0。

```。

这条命令将为VLAN接口Vlanif1配置IP地址为192.168.1.1,子网掩码为255.255.255.0。

4. 配置交换机VLAN。

除了配置接口,我们还可以对交换机的VLAN进行配置。

比如,我们可以使用以下命令创建一个VLAN:```shell。

vlan 10。

```。

这条命令将创建一个VLAN ID为10的VLAN。

5. 配置交换机路由。

在需要进行路由配置时,我们可以使用以下命令添加静态路由:```shell。

ip route-static 0.0.0.0 0.0.0.0 192.168.1.254。

```。

华为路由器交换机常用命令

华为路由器交换机常用命令

华为路由器交换机常用命令一、设备管理命令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业务环回组。

华为交换机常见命令

华为交换机常见命令

一、清空配置:<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为例,配置如下。

华为交换机命令(带中文注释)

华为交换机命令(带中文注释)

华为交换机命令返回上一级命令:quit配置保存命令:save华为交换机命令<>sys进入配置模式[Quidway]dis cur ;显示当前配置[Quidway]display current-configuration ;显示当前配置[Quidway]display interfaces ;显示接口信息[Quidway]display vlan all ;显示路由信息[Quidway]display version ;显示版本信息[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名[Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP 地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关[Quidway]rip ;三层交换支持[Quidway]local-user ftp[Quidway]user-interface vty 0 4 ;进入虚拟终端[S3026-ui-vty0-4]authentication-mode password ;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别[Quidway]interface ethernet 0/1 ;进入端口模式[Quidway]int e0/1 ;进入端口模式[Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控[Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式[Quidway-Ethernet0/1]port access vlan 3 ;当前端口加入到VLAN[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN[Quidway-Ethernet0/3]port trunk pvid vlan 3 ;设置trunk端口的PVID [Quidway-Ethernet0/1]undo shutdown ;激活端口[Quidway-Ethernet0/1]shutdown ;关闭端口[Quidway-Ethernet0/1]quit ;返回[Quidway]vlan 3 ;创建VLAN [Quidway-vlan3]port ethernet 0/1 ;在VLAN中增加端口[Quidway-vlan3]port e0/1 ;简写方式[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 ;在VLAN中增加端口[Quidway-vlan3]port e0/1 to e0/4 ;简写方式[Quidway]monitor-port <interface_type interface_num> ;指定镜像端口[Quidway]port mirror <interface_type interface_num> ;指定被镜像端口[Quidway]port mirror int_list observing-port int_type int_num ;指定镜像和被镜像[Quidway]description string ;指定VLAN描述字符[Quidway]description ;删除VLAN描述字符[Quidway]display vlan [vlan_id] ;查看VLAN设置[Quidway]stp {enable|disable} ;设置生成树,默认关闭[Quidway]stp priority 4096 ;设置交换机的优先级[Quidway]stp root {primary|secondary} ;设置为根或根的备份[Quidway-Ethernet0/1]stp cost 200 ;设置交换机端口的花费[Quidway]link-aggregation e0/1 to e0/4 ingress|both ; 端口的聚合[Quidway]undo link-aggregation e0/1|all ; 始端口为通道号[SwitchA-vlanx]isolate-user-vlan enable ;设置主vlan [SwitchA]isolate-user-vlan <x> secondary <list> ;设置主vlan包括的子vlan[Quidway-Ethernet0/2]port hybrid pvid vlan <id> ;设置vlan的pvid [Quidway-Ethernet0/2]port hybrid pvid ;删除vlan的pvid [Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged ;设置无标识的vlan如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。

华为交换机常用配置命令

华为交换机常用配置命令

华为交换机基本配置命令一、单交换机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、配置文件相关命令[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业务环回组。

华为路由交换设备常用命令

华为路由交换设备常用命令

华为路由交换机设备常用命令一.系统基本配置命令display clock命令用来查看系统当前日期和时钟。

display diagnostic-information命令用来查看系统当前诊断信息。

display history-command命令用来查看当前终端上保存的历史命令。

缺省情况下,显示最近10条历史命令。

display this命令用来查看系统当前视图的运行配置。

display version命令用来查看系统版本信息。

header命令用来设置用户登录设备时终端上显示的标题信息。

language-mode命令用来切换命令行接口的语言模式。

缺省情况下,命令行接口的语言模式为英文模式。

quit命令用来从当前视图退回到较低级别视图,如果是用户视图,则退出系统。

return命令用来从除用户视图外的其它视图退回到用户视图。

sysname命令用来设置路由器的主机名。

使用实例# 设置路由器的主机名为HUAWEIA。

<HUAWEI> system-view[HUAWEI] sysname HUAWEIAsystem-view命令用来使用户从用户视图进入系统视图。

user-interface命令用来进入一个用户界面视图或多个用户界面视图。

user-interface maximum-vty命令用来设置登录用户的最大数目。

使用实例# 配置VTY用户界面最大数目为7个。

<HUAWEI> system-view[HUAWEI] user-interface maximum-vty 7authentication-mode命令用来设置登录用户界面的验证方式。

# 使能本地密码验证。

<HUAWEI> system-view[HUAWEI] user-interface vty 0[HUAWEI-ui-vty0] authentication-mode passworddisplay user-interface命令用来查看用户界面信息。

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

一、基本配置
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的工作模
式。

[h3c]undo stp mode //恢复为默认的模式。

默认为MSTP模式。

[h3c]stp max-hops 5 //设置MST域的最大跳
数,以限制域的规模。

最大跳数为20。

相关文档
最新文档