08-20200731-华为交换机命令行配置指南

配置了几次华为交换机,这次记录一下配置过程

配置的目的很简单,就是建一个vlan,把所有端口装里面

目录

华为交换机配置指南

console口串口配置

  • 物理接线:RS232
  • 使用超级终端连接
  • 串口号: comx
  • 波特率:9600
  • 数据位:8
  • 校验方式:无
  • 停止位:1
  • 流控制:无

1 默认密码登陆与修改

物理连接完成,通过超级终端连接后,重启交换机,超级终端有数据打印,表明链路正常。

使用默认用户名登陆

此步骤强制修改密码,注意保存好修改后的密码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Task awake begin ...
Task awake end

Recover configuration begin ...
Recover configuration end
Press ENTER to get started.


Login authentication


Username:admin
Password:
Warning: The default password poses security risks.
The password needs to be changed. Change now? [Y/N]:

2 进入设备配置视图

需进入设备配置视图才能进行系统配置

输入 display current-configuration 可查看当前系统配置信息

注意打印信息的 <> 变为 []

1
2
3
4
5
6
7
8
9
10
11
12
<HUAWEI>system-view 
Enter system view, return user view with Ctrl+Z.
[HUAWEI]display current-configuration
!Software Version V200R019C00SPC500
#
sysname HUAWEI
#
authentication-profile name default_authen_profile
authentication-profile name dot1x_authen_profile
authentication-profile name dot1xmac_authen_profile
authentication-profile name mac_authen_profile
······

3 设备需要的vlan建立

1
2
3
4
5
[HUAWEI]vlan 10
Info: This operation may take a few seconds. Please wait for a moment...done.
[HUAWEI-vlan10]
Apr 25 2020 21:21:57 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 4, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI-vlan10]quit

vlan XX XX任意主要是把所有端口都加到一起

4 配置vlan ip 与查看

注意中间会退出配置视图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[HUAWEI]interface Vlanif 10
[HUAWEI-Vlanif10]
Apr 25 2020 21:26:48 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 5, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI-Vlanif10]ip address 192.168.0.1 255.255.255.0
[HUAWEI-Vlanif10]
Apr 25 2020 21:27:58 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 6, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI-Vlanif10]quit
[HUAWEI]display arp
IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VPN-INSTANCE
VLAN
-----------------------------------------------------------
192.168.1.253 c444-7d51-a878 I - MEth0/0/1
192.168.0.1 c444-7d51-a878 I - Vlanif10
-----------------------------------------------------------
Total:2 Dynamic:0 Static:0 Interface:2
[HUAWEI]

5 普通光口的配置

1
2
3
4
5
6
7
8
9
[HUAWEI]interface GigabitEthernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1]port link-type access
Info: This operation may take a few seconds. Please wait for a moment...done.
[HUAWEI-GigabitEthernet0/0/1]
Apr 25 2020 21:55:39 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 7, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI-GigabitEthernet0/0/1]port default vlan 10
[HUAWEI-GigabitEthernet0/0/1]
Apr 25 2020 21:56:19 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 8, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI-GigabitEthernet0/0/1]quit

6 所用型号功能分区

p1.png

看图,光口和电口没有冲突,主要的工作是把所有口都链接到 vlan10

7 保存退出

退出配置模式,保存

1
2
[HUAWEI]quit
<HUAWEI>save