基本配置

(1)进入交换机默认模式:用户模式(用户视图)

<Huawei>

(2)用户模式进入特权模式(系统视图)

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]

(3)特权模式进入接口模式:

[Huawei]interface  GigabitEthernet0/0/1
[Huawei-GigabitEthernet0/0/1]quit   //退出命令
[Huawei]

(4)系统视图下进入路由协议模式

[Huawei]rip
[Huawei-rip-1]quit
[Huawei]
[Huawei]ospf
[Huawei-ospf-1]quit
[Huawei]

(5)系统视图下设置设备命名:

[Huawei]sysname switch1
[switch1]

(6)设置系统时间和时区

<Huawei>clock timezone Beijing add 8
<Huawei>clock datetime 8:0:0  2023-2-15

(7)设置console口密码

[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode  password
[Huawei-ui-console0]set authentication password cipher huawei
[Huawei-ui-console0]quit
[Huawei]

(8) 设置telnet密码

[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode password
[Huawei-ui-vty0-4]user privilege level 3
[Huawei-ui-vty0-4]set authentication password simple  huawei
[Huawei-ui-vty0-4]
用户级别命令级别说明
0(参观级)0网络诊断类命令(ping、tacert),从设备访问替他设备的命令(Telnet)等。
1(监控级)0、1系统维护命令,比如大部分的display等命令。
2(配置级)0、1、2业务配置命令
3(管理级)0、1、2、3设计系统基本运行的命令,故障诊断命令debugging命令、还有部分display命令:display current-configuration和save-configuration

(9)保存配置命令

<Huawei>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y

(10) 清空配置文件

<Huawei>reset saved-configuration
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y

(11)重启设备

<Huawei>reboot

(12)查看设备配置信息

<Huawei>display  current-configuration

(13)配置IP地址

[Huawei]interface Vlanif 1
[Huawei-Vlanif1]ip address 192.16.1.1 24
[Huawei-Vlanif1]

(14)打开端口、关闭端口

[Huawei]interface Eth0/0/1
[Huawei-Ethernet0/0/1]shutdown
[Huawei-Ethernet0/0/1]undo shutdown

(15)查看端口状态

[Huawei]display interface  GigabitEthernet0/0/1
GigabitEthernet0/0/1 current state : DOWN
Line protocol current state : DOWN
Description:
Route Port,The Maximum Frame Length is 9216
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccc8-97ff
Last physical up time   : -
Last physical down time : 2023-02-15 19:33:54 UTC-08:00
Current system time: 2023-02-15 09:09:16+08:00
Hardware address is 4c1f-ccc8-97ff
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 0 bytes, 0 packets
Output: 0 bytes, 0 packets
Input:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization  :    0%
Output bandwidth utilization :    0%
[Huawei]

(16)测试网络连通性

ping  192.168.1.1

(17)查看路由表

[Huawei]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 2        Routes : 2
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
[Huawei]

(18)关闭日志信息上报

[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]
最后修改:2023 年 07 月 24 日
如果觉得我的文章对你有用,请随意赞赏