DC娱乐网

华为交换机路由器配置命令最常用合集

在日常网络运维中,华为设备(VRP 系统)的配置命令看似很多,但真正高频使用的,其实就那么几十条。这篇文章我帮你整理了一

在日常网络运维中,华为设备(VRP 系统)的配置命令看似很多,但真正高频使用的,其实就那么几十条。

这篇文章我帮你整理了一份生产环境最常用的 TOP50 华为配置命令,并按场景分类,基本覆盖你 80% 的工作场景。

建议收藏 + 背下来,排障效率能直接翻倍。

一、基础管理类(10条)

这是你登录设备后,最先会用到的一组命令。

序号

命令

作用

1

system-view

进入系统视图

2

sysname SW1

修改设备名称

3

undo info-center enable

关闭日志提示

4

save

保存配置

5

quit

返回上一级

6

return

直接返回用户视图

7

reboot

重启设备

8

display current-configuration

查看当前配置

9

display version

查看版本

10

display device

查看设备信息

二、接口配置类(10条)

接口配置是最基础也是最常用的操作。

序号

命令

作用

11

interface GigabitEthernet0/0/1

进入接口

12

description To-Core-SW

配置接口描述

13

ip address 192.168.1.1 24

配置 IP

14

undo shutdown

启用接口

15

shutdown

关闭接口

16

display interface brief

查看接口状态

17

display interface GigabitEthernet0/0/1

查看接口详细

18

speed 1000

设置速率

19

duplex full

设置双工

20

mtu 1500

设置 MTU

三、VLAN 与二层配置(10条)

企业网络中最常见的部分。

序号

命令

作用

21

vlan 10

创建 VLAN

22

port link-type access

设置接入口

23

port default vlan 10

接口加入 VLAN

24

port link-type trunk

设置 trunk

25

port trunk allow-pass vlan 10 20

放行 VLAN

26

display vlan

查看 VLAN

27

display mac-address

查看 MAC 表

28

mac-address static

静态 MAC

29

stp enable

开启 STP

30

display stp brief

查看 STP

四、三层与路由配置(10条)

涉及网关、跨网段通信。

序号

命令

作用

31

interface Vlanif10

创建三层接口

32

ip address 192.168.10.1 24

VLAN 网关

33

ip route-static 0.0.0.0 0.0.0.0 192.168.1.254

默认路由

34

display ip routing-table

查看路由表

35

ping 192.168.1.1

测试连通

36

tracert 8.8.8.8

路由追踪

37

arp

查看 ARP

38

display arp

查看 ARP 表

39

undo arp

清 ARP

40

ip address dhcp-alloc

DHCP 获取 IP

五、远程管理与安全(5条)

远程登录和基础安全配置。

序号

命令

作用

41

user-interface vty 0 4

进入远程配置

42

authentication-mode aaa

启用认证

43

set authentication password simple 123456

设置密码

44

stelnet server enable

开启 SSH

45

ssh user admin authentication-type password

SSH 用户

六、系统与辅助配置(5条)

一些“经常用但容易忽略”的命令。

序号

命令

作用

46

clock timezone BJ add 08:00:00

设置时区

47

ntp-service enable

开启 NTP

48

ntp-service unicast-server x.x.x.x

NTP 服务器

49

display logbuffer

查看日志

50

reset counters interface

清接口计数

把这 50 条命令熟练掌握,已经能应对绝大多数网络配置和基础排障。

如果你是老网工:

这些命令就是你每天敲最多的“肌肉记忆”。

华为 CLI 有个特点:支持缩写(sys、int、dis)善用 ?:命令提示神器多用 display 系列:排障核心