一、清空配置:resetsaved-configuration(清楚下次启动时使用的配置文件信息)然后重启设备,重启设备室提示保存信息,选择“NO”。resetsaved-configurationWarning:Theactionwilldeletethesavedconfigurationinthedevice.Theconfigurationwillbeerasedtoreconfigure.Continue?[Y/N]:yWarning:Nowclearingtheconfigurationinthedevice.Info:Succeededinclearingtheconfigurationinthedevice.rebootInfo:Thesystemisnowcomparingtheconfiguration,pleasewait.Warning:Theconfigurationhasbeenmodified,anditwillbesavedtothenextstartupsaved-configurationfileflash:/vrpcfg.zip.Continue?[Y/N]:n//此处请选择“N”Info:Ifwanttorebootwithsavingdiagnosticinformation,input'N'andthenexecute'rebootsavediagnostic-information'.Systemwillreboot!Continue?[Y/N]:y二、通过STelnet/Telnet登录交换机设置新的Console口登录密码#以登录用户界面的认证方式为密码认证,密码为Huawei@123为例,配置如下。system-view[HUAWEI]user-interfaceconsole0[HUAWEI-ui-console0]authentication-modepassword[HUAWEI-ui-console0]setauthenticationpasswordcipherHuawei@123[HUAWEI-ui-console0]returnsave#以登录用户界面的认证方式为AAA认证,用户名为admin123,密码为Huawei@123为例,配置如下。system-view[HUAWEI]user-interfaceconsole0[HUAWEI-ui-console0]authentication-modeaaa[HUAWEI-ui-console0]quit[HUAWEI]aaa[HUAWEI-aaa]local-useradmin123passwordirreversible-cipherHuawei@123[HUAWEI-aaa]local-useradmin123service-typeterminal(本地防务终端用户)[HUAWEI-aaa]return(返回)save(保存)三、查看某个接口学习到的MAC地址displaymac-addressdynamicgigabitethernet1/0/1MACAddressVLAN/VSILearned-FromType-------------------------------------------------------------------------0000-0000-0003300/-GE1/0/1dynamic0026-6e5c-feac3000/-GE1/0/1dynamic四、查看某个VLAN学习到的MAC地址displaymac-addressdynamicvlan10MACAddressVLAN/VSILearned-FromType--------------------------------------------------------------------------0000-0000-000310/-GE1/0/1dynamic0026-6e5c-feac10/-GE1/0/2dynamic五、查看系统的MAC地址displayinterfacegigabitethernet1/0/1GigabitEthernet1/0/1currentstate:UPLineprotocolcurrentstate:UPDescription:SwitchPort,Link-type:access(configured),IPSendingFrames'FormatisPKTFMT_ETHNT_2,Hardwareaddressis00e0f74b-6d00六、根据IP获取对应设备的MAC地址displayarp|include192.168.150.20配置端口安全#配置GE1/0/1接口的端口安全功能。system-view[HUAWEI]interfacegigabitethernet1/0/1[HUAWEI-GigabitEthernet1/0/1]port-securityenable#配置GE1/0/1接口的MAC地址学习限制数为5,即最多可以学习到5个MAC地址表项。system-view[HUAWEI]interfacegigabitethernet1/0/1[HUAWEI-GigabitEthernet1/0/1]port-securityenable[HUAWEI-GigabitEthernet1/0/1]port-securitymax-mac-num5配置永久端口组#配置接口GE1/0/1至GE1/0/8加入到永久端口组portgroup1(使用port-group命令)system-view[HUAWEI]port-groupportgroup1[HUAWEI-port-group-portgroup1]group-membergigabitethernet1/0/1togigabitethernet1/0/8配置接口速率自协商模式下,手动配置接口速率#配置以太网接口GE1/0/1在自协商模式下协商速率为100Mbit/s。system-view[HUAWEI]interfacegigabitethernet1/0/1[HUAWEI-GigabitEthernet1/0/1]negotiationauto[HUAWEI-GigabitEthernet1/0/1]autospeed100配置双工模式自协商模式下,手动配置双工模式#配置以太网电接口GE1/0/1在自协商模式下双工模式为全双工模式。system-view[HUAWEI]interfacegigabitethernet1/0/1[HUAWEI-GigabitEthernet1/0/1]negotiationauto[HUAWEI-GigabitEthern...