如题所述
第1个回答 2021-01-16
步骤一:进入配置终端及切换视图
1)进入系统视图
The device is running!
<Huawei> //用户模式
<Huawei> system-view //切进系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei] //系统视图12345
2)进入接口g0/0/1的接口视图
[Huawei] interface GigabitEthernet 0/0/1 //切进接口视图[Huawei-GigabitEthernet0/0/1] //接口视图12
3)返回系统视图、返回用户视图
[Huawei-GigabitEthernet0/0/1] quit[Huawei] quit
<Huawei>123
4)重新进入接口g0/0/1的接口视图,快速返回用户视图
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.[Huawei]interface GigabitEthernet 0/0/1[Huawei-GigabitEthernet0/0/1] //按Ctrl+Z快捷键
<Huawei> //已快速返回到用户模式12345
步骤二:命令行编辑技巧
1)练习TAB补全
<Huawei>sys<TAB> //输入sys后按TAB键
<Huawei>system-view //自动补全完整命令12
2)命令简写
<Huawei>sys //进系统视图的简写
Enter system view, return user view with Ctrl+Z.[Huawei][Huawei]int g0/0/1 //进接口模式的简写[Huawei-GigabitEthernet0/0/1]12345
3)?帮助的用法
[Huawei-GigabitEthernet0/0/1]display ver? //在命令后加 ?会提示用法
version
[Huawei-GigabitEthernet0/0/1]display versio
[Huawei-GigabitEthernet0/0/1]display version ?
slot Slot | Matching output
<cr> 1234567
案例6:
交换机基础配置
6.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:将交换机lsw1的设备名设为 lsw1
1)为所有用户添加初始化命令
<Huawei> system-view
Enter system view, return user view with Ctrl+Z.[Huawei] sysname lsw1 //将设备名设置为 sw1[lsw1]1234
步骤二:禁用/启用交换机上连接pc1-1的接口(比如g0/0/1)
1)禁用g0/0/1接口(连接pc1-1的接口)
[lsw1]int g0/0/1 //进接口配置[lsw1-GigabitEthernet0/0/1] shutdown //禁用接口
Jul 12 2018 13:31:05-08:00 lsw1 %%01PHY/1/PHY(l)[0]: GigabitEthernet0/0/1: change status to down //此接口状态为down1234
2)从主机pc1-1测试ping主机pc1-2,已无法连通
3)重新将连接pc1-1的g0/0/1接口启用
[lsw1-GigabitEthernet0/0/1] undo shutdown
Jul 12 2018 13:31:31-08:00 lsw1 %%01PHY/1/PHY(l)[1]:
GigabitEthernet0/0/1: change status to up //此接口状态为up123
4)再次从主机pc1-1测试ping主机pc1-2,已恢复连通
步骤三:检查、保存交换机配置
1)查看当前配置
<lsw1> display current-configuration //查看配置#sysname lsw1#cluster enable
ntdp enable
ndp enable#undo nap slave enable#drop illegal-mac alarm#diffserv domain default#drop-profile default
.. .. //按q可退出查看
<lsw1> 1234567891011121314151617
2)保存当前配置
<lsw1> save //保存配置
The current configuration will be written to the device.
Are you sure to continue?[Y/N]Y //输入Y确认
Now saving the current configuration to the slot 0.
Jul 25 2018 12:46:15-08:00 lsw1 %%01CFM/4/SAVE(l)[2]:The user chose Y when decid
ing whether to save the configuration to the device.
Save the configuration successfully.
<lsw1>
1)进入系统视图
The device is running!
<Huawei> //用户模式
<Huawei> system-view //切进系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei] //系统视图12345
2)进入接口g0/0/1的接口视图
[Huawei] interface GigabitEthernet 0/0/1 //切进接口视图[Huawei-GigabitEthernet0/0/1] //接口视图12
3)返回系统视图、返回用户视图
[Huawei-GigabitEthernet0/0/1] quit[Huawei] quit
<Huawei>123
4)重新进入接口g0/0/1的接口视图,快速返回用户视图
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.[Huawei]interface GigabitEthernet 0/0/1[Huawei-GigabitEthernet0/0/1] //按Ctrl+Z快捷键
<Huawei> //已快速返回到用户模式12345
步骤二:命令行编辑技巧
1)练习TAB补全
<Huawei>sys<TAB> //输入sys后按TAB键
<Huawei>system-view //自动补全完整命令12
2)命令简写
<Huawei>sys //进系统视图的简写
Enter system view, return user view with Ctrl+Z.[Huawei][Huawei]int g0/0/1 //进接口模式的简写[Huawei-GigabitEthernet0/0/1]12345
3)?帮助的用法
[Huawei-GigabitEthernet0/0/1]display ver? //在命令后加 ?会提示用法
version
[Huawei-GigabitEthernet0/0/1]display versio
[Huawei-GigabitEthernet0/0/1]display version ?
slot Slot | Matching output
<cr> 1234567
案例6:
交换机基础配置
6.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:将交换机lsw1的设备名设为 lsw1
1)为所有用户添加初始化命令
<Huawei> system-view
Enter system view, return user view with Ctrl+Z.[Huawei] sysname lsw1 //将设备名设置为 sw1[lsw1]1234
步骤二:禁用/启用交换机上连接pc1-1的接口(比如g0/0/1)
1)禁用g0/0/1接口(连接pc1-1的接口)
[lsw1]int g0/0/1 //进接口配置[lsw1-GigabitEthernet0/0/1] shutdown //禁用接口
Jul 12 2018 13:31:05-08:00 lsw1 %%01PHY/1/PHY(l)[0]: GigabitEthernet0/0/1: change status to down //此接口状态为down1234
2)从主机pc1-1测试ping主机pc1-2,已无法连通
3)重新将连接pc1-1的g0/0/1接口启用
[lsw1-GigabitEthernet0/0/1] undo shutdown
Jul 12 2018 13:31:31-08:00 lsw1 %%01PHY/1/PHY(l)[1]:
GigabitEthernet0/0/1: change status to up //此接口状态为up123
4)再次从主机pc1-1测试ping主机pc1-2,已恢复连通
步骤三:检查、保存交换机配置
1)查看当前配置
<lsw1> display current-configuration //查看配置#sysname lsw1#cluster enable
ntdp enable
ndp enable#undo nap slave enable#drop illegal-mac alarm#diffserv domain default#drop-profile default
.. .. //按q可退出查看
<lsw1> 1234567891011121314151617
2)保存当前配置
<lsw1> save //保存配置
The current configuration will be written to the device.
Are you sure to continue?[Y/N]Y //输入Y确认
Now saving the current configuration to the slot 0.
Jul 25 2018 12:46:15-08:00 lsw1 %%01CFM/4/SAVE(l)[2]:The user chose Y when decid
ing whether to save the configuration to the device.
Save the configuration successfully.
<lsw1>