Top

NSD NETWORK DAY01

  1. 案例1:eNSP软件与交换机命令行
  2. 案例2:访问及配置交换机
  3. 案例3:验证交换机工作原理

1 案例1:eNSP软件与交换机命令行

1.1 问题

1.2 方案

在eNSP程序主窗口中,添加一台s3700交换机,进入交换机,输入相关命令进行配置和查看交换机

1.3 步骤

实现此案例需要按照如下步骤进行

步骤一:改变命令行视图

  1. <Huawei>system-view             //进入系统视图
  2. [Huawei]interface Ethernet0/0/1 //进入接口视图
  3. [Huawei-Ethernet0/0/1]quit    //返回上一视图
  4. [Huawei]
  5. [Huawei]interface Ethernet0/0/1 //再次进入接口视图
  6. [Huawei-Ethernet0/0/1]return     //返回用户视图
  7. <Huawei>

2 案例2:访问及配置交换机

2.1 问题

2.2 方案

在eNSP程序主窗口中,添加一台s3700交换机,进入交换机,输入相关命令进行配置和查看交换机

2.3 步骤

实现此案例需要按照如下步骤进行

步骤一:修改交换机主机名

进入系统视图后,使用sysname指令可以为交换机设置主机名。例如,以下操作可以将主机名设置为SW1

  1. <Huawei>system-view
  2. [Huawei]sysname SW1
  3. [SW1]

步骤二:显示VRP版本

  1. [Huawei]display version
  2. Huawei Versatile Routing Platform Software
  3. VRP (R) software, Version 5.110 (S3700 V200R001C00)
  4. Copyright (c) 2000-2011 HUAWEI TECH CO., LTD
  5.  
  6. Quidway S3700-26C-HI Routing Switch uptime is 0 week, 0 day, 0 hour, 17 minutes

步骤三:查看交换机配置

查看ios名称及版本信息

  1. [Huawei]display current-configuration
  2. #
  3. sysname Huawei
  4. #
  5. cluster enable
  6. ntdp enable
  7. ndp enable
  8. #
  9. drop illegal-mac alarm
  10. #
  11. diffserv domain default
  12. #
  13. drop-profile default
  14. #

步骤四:使用账户和密码登录终端

  1. <Huawei>system-view
  2. [Huawei]aaa                    //进入aaa认证
  3. [Huawei-aaa]local-user admin01 password cipher 123 //创建账户叫admin01,密码123
  4. [Huawei-aaa]quit
  5. [Huawei]user-interface console 0        
  6. [Huawei-ui-console0]authentication-mode aaa     //激活配置

步骤五:保存交换机的配置

  1. <Huawei>save        
  2. The current configuration will be written to the device.
  3. Are you sure to continue?[Y/N]y                    //这里按y确认
  4. Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
  5. Mar 12 2019 19:12:18-08:00 Huawei %%01CFM/4/SAVE(l)[0]:The user chose Y when dec
  6. iding whether to save the configuration to the device.
  7. Now saving the current configuration to the slot 0.
  8. Save the configuration successfully.

步骤六:恢复设备出厂默认值

  1. <Huawei>reset saved-configuration //重置配置文件
  2. Warning: The action will delete the saved configuration in the device.
  3. The configuration will be erased to reconfigure. Continue? [Y/N]:y //是否擦除,回答y
  4. Warning: Now clearing the configuration in the device.
  5. Mar 12 2019 19:13:50-08:00 Huawei %%01CFM/4/RST_CFG(l)[1]:The user chose Y when
  6. deciding whether to reset the saved configuration.
  7. Info: Succeeded in clearing the configuration in the device.
  8.  
  9. <Huawei>reboot        //重启设备
  10. Info: The system is now comparing the configuration, please wait.
  11. Warning: All the configuration will be saved to the configuration file for the n
  12. ext startup:, Continue?[Y/N]:n            //提示是否再次保存,选择n
  13. Info: If want to reboot with saving diagnostic information, input 'N' and then e
  14. xecute 'reboot save diagnostic-information'.
  15. System will reboot! Continue?[Y/N]:y //是否重启,选择y

3 案例3:验证交换机工作原理

3.1 问题

通过2台交换机以及4台pc设备分析交换机工作原理

3.2 方案

实现此目的需要先搭建拓扑,如图-1所示

图-1

3.3 步骤

步骤一:pc设备配置

为不同pc设置ip地址与子网掩码,分别是192.168.0.1/24~192.168.0.4/24,配置完毕点击右下角应用,如图-2所示

图-2

步骤二:通过pc设备的命令行界面使用ping命令对其他设备发起访问

如图-3所示

图-3

步骤三:在交换机中查看MAC地址表

  1. [Huawei]display mac-address
  2. MAC address table of slot 0:
  3. -------------------------------------------------------------------------------
  4. MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
  5. VSI/SI MAC-Tunnel
  6. -------------------------------------------------------------------------------
  7. 5489-987d-68c4 1 - - Eth0/0/1 dynamic 0/-
  8. 5489-9806-61a2 1 - - Eth0/0/2 dynamic 0/-
  9. 5489-98d8-3d5d 1 - - Eth0/0/3 dynamic 0/-
  10. 5489-98d3-6953 1 - - Eth0/0/3 dynamic 0/-
  11. -------------------------------------------------------------------------------