华为设备常用命令

[Huawei-Ethernet0/0/1]
0/0/1:第一个“0”代表槽位号,第二个“0”代表子卡号,“1”代表接口号
<Huawei>system-view 进入系统试图
[Huawei]interface GigabitEthernet 0/0/0 接口视图
[Huawei]quit 退出 ctrl+z
[Huawei]sysname 12 改名
[Huawei]display version 查看设备版本
[Huawei]display current-configuration 查看配置
(uawei]user-interface console 0
[Huawei-ui-console0]authentication-mode password
[Huawei-ui-console0]set authentication password simple 123
?交换机设置明文和密文密码 *
[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode password
[Huawei-ui-console0]set authentication password cipher 123)
([Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode password
Please configure the login password (maximum length 16):123
路由器设置密码)
([Huawei]aaa
[Huawei-aaa]local-user admin01 password cipher 123456
[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode aaa
?交换机设置用户
[Huawei]aaa
[Huawei-aaa]local-user admin01 password simple 123456
[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode aaa)
([Huawei]aaa
[Huawei-aaa]local-user admin01 password cipher 123456
[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode aaa
?交换机设置用户)
<Huawei>save 保存
<Huawei>reboot 重启
<Huawei>reset saved-configuration 恢复出厂配置
([Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 10 10
设置关闭时间)
([Huawei]user-interface 0
[Huawei-ui0]screen-length 24
设置显示命令行数)
<Huawei>undo terminal monitor 不起动提示
[Huawei]clear configuration interface Ethernet 0/0/3 清空端口配置
<Huawei>display mac-address 查看MAC地址表
[Huawei]display bridge mac-address 查看交换机MAC地址
[Huawei]lldp enable 开启lldp邻居信息
[Huawei]display lldp neighbor brief 查看邻居设备信息
[Huawei]display lldp neighbor 查看邻居设备信息摘要
[Huawei]display lldp neighbor interface Ethernet 0/0/5 按接口查看
[Huawei-Ethernet0/0/3]display this 查看当前配置
[Huawei-Ethernet0/0/3]undo negotiation auto 关闭自动协商双工配置
[Huawei-Ethernet0/0/3]duplex half 开启半双工
[Huawei-Ethernet0/0/3]duplex full 开启全双工
[Huawei-Ethernet0/0/3]speed 100 配置速率在非自动协商模式下
<Huawei>display ip routing-table 查看路由表
[Huawei]ip route-static 目标网络ID 子网掩码 下一跳地址 配置静态路由
[Huawei]user-interface vty 0 4 开启远程
[Huawei-ui-vty0-4]authentication-mode password 设置密码
Please configure the login password (maximum length 16):123
[Huawei-ui-vty0-4]protocol inbound telnet 设置
[Huawei-ui-vty0-4]user privilege level 15 设置权限
PC端telnet ip地址 远程

VLAN配置相关命令
[Huawei]vlan 12 创建单个vlan
[Huawei-vlan12]description vlan-qq VLAN改名
[Huawei]vlan batch 10 20 30 批量创建VLAN
[Huawei]vlan batch 10 to 20 连续创建VLAN
[Huawei]undo vlan 10 删除VLAN
[Huawei]interface Ethernet 0/0/1 进入端口
[Huawei-Ethernet0/0/1]port link-type access 修改模式
[Huawei-Ethernet0/0/1]port default vlan 10 端口加入VLAN
[Huawei]port-group 1 创建组批量加入VLAN
[Huawei-port-group-1]group-member Ethernet 0/0/1 to Ethernet 0/0/2 加入VLAN
[Huawei]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/6 创建临时组
<Huawei>display vlan 查看VLAN配置
[Huawei-Ethernet0/0/5]port link-type trunk 开启创客
[Huawei-Ethernet0/0/5]port trunk allow-pass vlan all 允许所有通过
[Huawei-Ethernet0/0/5]port trunk allow-pass vlan 10 允许单个通过
[Huawei-Ethernet0/0/1]port link-type hybrid 设置HYBRID 模式
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10 为HYBRID端口配置pvid
[Huawei-Ethernet0/0/1]port hybrid tagged vlan 10 有标签允许帧通过
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10 没有标签允许帧通过
配置GRP功能 交换机互相学习
[Huawei]gvrp 开启
[Huawei]interface Ethernet 0/0/20 进入端口
[Huawei-Ethernet0/0/20]port link-type trunk 开TRUNK
[Huawei-Ethernet0/0/20]port trunk allow-pass all 允许所有VLAN [Huawei-Ethernet0/0/20]gvrp 端口开启
[Huawei-Ethernet0/0/20]gvrp registration normal 配置GVRP

静态路由配置
[Huawei]ip route-static 192.168.2.0 255.255.255.0 192.168.23.3 静态路由
[Huawei]display ip interface brief 查看路由
[Huawei]display ip routing-table 查看路由
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.100.2 preference 80 浮动路由配置 数字大小代表优先级高低

[Huawei]interface vlanif 13 VLAN配置IP
ip address 192.168.13.254 255.255.255.0 VLAN配置IP

STP配置相关命令
[huawei]stp disable 关闭 该交换机的 STP 功能
[huawei]stp enable 开启 该交换机的 STP 功能,默认就是开启的
[huawei]stp mode {stp | rstp | mstp } 配置 交换机运行的 STP 的模式,华为默认是 MSTP
[huawei]stp priority 32768 STP的优先级,默认是 32768 ,设置时数值必须是 4096的倍数
[huawei]interface gi0/0/23 进入接口
[huawei-gi0/0/23] stp {enable | disable } 默认是开启的,也可以基于实际应用场景选择关闭STP
[huawei-gi0/0/23] stp cost 20000 修改一个端口上的 STP 的 cost 。
[huawei]display stp 可以查看到交换机运行的 STP 的模式,以及自己和根交换机的 BID 信息。
[huawei]display stp brief 可以查看到交换机上的每个启用了 STP 的端口的角色与状态;
[huawei]display stp interface gi0/0/23 可以查看该接口的 cost ,以及发送和接收BPDU的情况

MSTP配置:创建VLAN
vlan batch 10 20 30 40 在每个交换机上批量创建 vlan ; [SWA]port-group group-member gi0/0/1 gi0/0/2 临时组
[SWA-port-group] port link-type trunk 开启创客
[SWA-port-group] port trunk allow-pass vlan all 允许所有 vlan通过
[SWA] stp mode mstp 开启MSTP模式
[SWA]stp region-configuration 进入
[SWA-mst-region]region-name HCIE 创建区域
[SWA-mst-region] instance 1 vlan 10 20 创建实例 1
[SWA-mst-region] instance 2 vlan 30 40 创建实例2
[SWA-mst-region] active region-configuration 激活
[SWA] stp instance 1 priority 0 设置优先级
[SWA] stp instance 2 priority 4096 设置优先级
[SWA]display stp 查看 STP 的运行模式;
[SWA]display stp instance 1/2 在交换机上查看修改之后的优先级是否生效;
[SWA]display stp instance 1/2 brief 查看属于某个特定 instance 的

DHCP 配置相关命令
[Huawei]dhcp enable 开启DHCP服务
[Huawei]ip pool 1 创建DHCP 地址池
[Huawei-ip-pool-1]network 192.168.1.1 mask 255.255.255.0 设置IP
[Huawei-ip-pool-1]gateway-list 192.168.1.254 设置网关
[Huawei-ip-pool-1]dns-list 8.8.8.8 设置DNS
[Huawei]interface GigabitEthernet 0/0/1 进入接口
[Huawei-GigabitEthernet0/0/1]dhcp select global 开启接口
开启DHCP中继
[Huawei-GigabitEthernet0/0/1]dhcp select relay DHCP中继
[Huawei-GigabitEthernet0/0/1]dhcp relay server-ip 192.168.2.1 DHCP中继
[Huawei-GigabitEthernet0/0/1]dhcp select interface DHCP 端口
[Huawei-GigabitEthernet0/0/1]dhcp server excluded-ip-address 192.168.1.1 192.168.1.100 设置保留地址

动态路配置相关命令
[Huawei]rip 进入模式
[Huawei-rip-1]version 2 选择版本
[Huawei-rip-1]network 192.168.1.0 宣告路由

VRRP配置相关命令
interface gi0/0/2
ip address 192.168.1.254 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.250 配置虚拟IP vrrp vrid 1 priority 200 配置优先级为 200,确保为主设备
display vrrp 查看命令
interface gi0/0/0
vrrp vrid 1 timer {数值} <---更改 master 设备发送报文的周期时间。
(VRRP认证:明文, simple密文, md5
interface gi0/0/0
vrrp vrid 1 authentication-mode simple HCIE
注意:如果 VRRP 认证不成功的话,有可能会导致网络中同时存在多个master;)
[R1]interaface gi0/0/1 进入端口
[R1-gi0/0/1] vrrp vrid 1 track interface gi0/0/0 reduced 150 端口跟踪

ACL配置相关命令
[R1] acl 2000 配置基本ACL
[R1-acl-basic-2000] rule 5 deny source 192.168.1.0 0.0.0.255调用ACL
[R1]interface gi0/0/2 进入端口
[R1-gi0/0/2] traffic-filter inbound acl 2000 调用ACL
[R1] display acl 2000 查看ACL
display traffic-filter applied-record : 查看的是本地设备上的 ACL 的调用情况
display traffic-filter statistic interface gi0/0/2 inbound/outbound 查看的特定端口的特定方向上的 ACL 的批量的流量以及处理动作。
display acl all : 查看设备上创建的所有的 ACL ;
display acl 3333 : 查看设备上特定的 ACL 3333 ;
acl 3333 创建高级ACL
rule 5 deny icmp source 192.168.1.254 0.0.0.0 destination 192.168.23.3 0.0.0.0
interface gi0/0/0 进入接口
traffic-filter outbound acl 3333 调用

{NAT配置相关命令} 转换成该接口的 公网IP 地址
[R1] nat static global 100.1.12.3 inside 192.168.1.1 静态NAT转换条目
[R1]interface gi0/0/1 在出端口开启NAT装换[R1-gi0/0/1] nat static enable 在出端口开启NAT装换
PAT/PNAT/NAT-Port/端口复用/端口NAT/ port NAT
[R1] acl 2000 创建ACL
[R1-acl-basic-2000] rule 5 permit source 192.168.1.1 0.0.0.0
[R1]interface gi0/0/1 端口调用
[R1-gi0/0/1] nat outbound 2000 端口调用

{OSPF设置相关命令}
<R1>reset ospf 1 process OSPF协议1 进行重启;
<R1> reset ospf process OSPF协议进程重启
<AR21>display ospf interface OSPF查看接口配置
<AR21>display ospf interface GigabitEthernet 0/0/2 查看单个接口明细
[AR22]ospf 创建OSPF
[AR22-ospf-1]area 0 创建区域
[AR22-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.255 广播

[AR22-GigabitEthernet0/0/0]ospf dr-priority 10 更改该端口用于竞选DR/BDR 时使用的优先级
[AR22-GigabitEthernet0/0/0]ospf network-type p2p 更改该端口的 OSPF 网络类型;

原文地址:http://blog.51cto.com/13598094/2105145

时间: 2024-08-10 05:41:21

华为设备常用命令的相关文章

华为设备------常用命令

命令 作用<Huawei> 用户模式<Huawei>system-view 进入系统模式[Huawei]interface GigabitEthernet 0/0/1 进入接口模式[Huawei]quit 退到前一模式[Huawei]return 退到用户模式<Huawei>reset saved-configuration 恢复出厂设置<Huawei>reboot 重启设备<Huawei>save 保存配置[Huawei]undo 取消配置&l

思科和华为交换机常用命令之对比学习

思科和华为交换机应该是网络项目中大家接触比较多的了,这两种交换机的常用 命令各有不同,本文结合网络项目中两种交换机的常用命令从对比的角度帮助大家来学习. 一. Switch#show  run 显示所有配置命令 Switch#show   ip   inter   brief   显示所有接口状态 Switch#show vlan  brief   显示所有VLAN的信息 Switch#show   version   显示版本信息 [Quidway]dis cur 显示所有配置命令 [Quid

华为交换机常用命令

sys 进入配置模式 检查  disp cu win系统中cmd telent 172.25.15.1   进去后输入密码,查看 disp cu

(转)linux常用查看硬件设备信息命令

场景:在一篇博客中看到这些总结性命令,感觉很实用就转载,以后用到进行相关的整理 系统 # uname -a               # 查看内核/操作系统/CPU信息# head -n 1 /etc/issue   # 查看操作系统版本# cat /proc/cpuinfo      # 查看CPU信息# hostname               # 查看计算机名# lspci -tv              # 列出所有PCI设备# lsusb -tv              #

linux常用查看硬件设备信息命令

linux常用查看硬件设备信息命令  系统  # uname -a # 查看内核/操作系统/CPU信息  # head -n 1 /etc/issue # 查看操作系统版本  # cat /proc/cpuinfo # 查看CPU信息  # hostname # 查看计算机名  # lspci -tv # 列出所有PCI设备  # lsusb -tv # 列出所有USB设备  # lsmod # 列出加载的内核模块  # env # 查看环境变量  资源  # free -m # 查看内存使用量

linux常用查看硬件设备信息命令(转载)

系统 # uname -a                                       # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue                              # 查看操作系统版本 # cat /proc/cpuinfo                                  # 查看CPU信息 # hostname                                            

华为设备VRP基础命令一

一.设备基本配置 1. 华为设备中,命令行界面中的尖括号< >和[ ]包含有设备名称,也称为设备主机名.缺省情况下名称为“Huawei”,修改设备主机名命令如下: system-view //进入系统视图 sysname host-name 2.配置设备系统时钟,华为设备出厂默认采用世界协调时(UTC),但没有配置时区. #设置时区 system-view //进入系统视图 clock timezone time-zone-name {add|minus} offset #例如: clock

h3c无线控制器常用命令(wx)

ttserv.exe是很好的WEB FTP Telnet TFTP程序,轻便,快捷. 该文件在哪个目录被打开,程序就默认在哪个位置传输文件. 一.进入系统状态 <H3C_AC>system-view System View: return to User View with Ctrl+Z. [H3C_AC] 2.常用命令 1.telnet:windows端远程连接与控制交换机的命令 2.quit:后退到上一级目录 3.system:进入管理模式 4.display current:显示当前交换

用xshell操作linux系统的常用命令

(1)命令ls——列出文件 ls -la 给出当前目录下所有文件的一个长列表,包括以句点开头的“隐藏”文件 ls a* 列出当前目录下以字母a开头的所有文件 ls -l *.doc 给出当前目录下以.doc结尾的所有文件 (2)命令cp——复制文件 cp afile afile.bak 把文件复制为新文件afile.bak cp afile /home/bible/ 把文件afile从当前目录复制到/home/bible/目录下 cp * /tmp 把当前目录下的所有未隐藏文件复制到/tmp/目