天天看点

交换机基本配置

实验需求:

  1. 将交换机 lsw1 的设备名设为 tedu-ntd-lsw1
  2. 禁用交换机上连接pc1-1 的接口(比如g0/0/1),然后检查 pc1-1 是否还能 ping 通 pc1-2
  3. 再启用交换机上连接pc1-1 的接口(比如g0/0/1),然后检查 pc1-1 是否还能 ping 通 pc1-2
  4. 检查、保存交换机配置

实验拓扑:

交换机基本配置

实验步骤:

1、将交换机 lsw1 的设备名设为 tedu-ntd-lsw1

为所有用户添加初始化命令
<Huawei> system-view
  Enter system view, return user view with Ctrl+Z. 
[Huawei] sysname tedu-ntd-lsw1      //将设备名设置为tedu-ntd-lsw1
[tedu-ntd-lsw1]      

2、禁用/启用交换机上连接pc1-1 的接口(比如g0/0/1)

禁用 g0/0/1 接口(连接 pc1-1 的接口)
[tedu-ntd-lsw1]int g0/0/1                               //进接口配置
[tedu-ntd-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      //此接口状态为 down      
将pc1-1和pc1-2配置静态地址
交换机基本配置
交换机基本配置
从主机 pc1-1 测试 ping 主机 pc1-2,已无法连通。
重新将连接 pc1-1 的 g0/0/1 接口启用
[tedu-ntd-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   //此接口状态为 up      
再次从主机 pc1-1 测试 ping 主机 pc1-2,已恢复连通。

3、检查、保存交换机配置

查看当前配置
<tedu-ntd-lsw1> display current-configuration    //查看配置
#
sysname tedu-ntd-lsw1 
#
cluster enable ntdp enable ndp enable
#
undo nap slave enable 
#
drop illegal-mac alarm 
#
diffserv domain default 
#
drop-profile default
.. ..                                            //按回车下一行   按 q 可退出查看
<lsw1>      
保存当前配置
<tedu-ntd-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.
<tedu-ntd-lsw1>