华为设备——交换机基本命令

案例一:改变命令行视图

<Huawei>                             //用户视图
<Huawei>system-view                  //进入系统视图
[Huawei]interface Ethernet0/0/1      //进入接口视图
[Huawei-Ethernet0/0/1]quit           //返回上一视图
[Huawei]

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

1.修改交换机主机名

[Huawei]sysname SW1                  //修改交换机主机名
[SW1]

2.显示VRP版本(VRP虚拟化仿真平台)

<Huawei>display version 
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.110 (S3700 V200R001C00)
Copyright (c) 2000-2011 HUAWEI TECH CO., LTD

Quidway S3700-26C-HI Routing Switch uptime is 0 week, 0 day, 0 hour, 0 minute

3.查看交换机配置

[Huawei]display current-configuration               //查看ios名称及版本信息

4.使用账户和密码登录

[Huawei]aaa                                       //进入aaa认证
[Huawei-aaa]local-user sw1 password cipher 123    //添加账户和密码(sw1为账户名,123为账户密码)
[Huawei-aaa]quit                                  //退出aaa认证
[Huawei]user-interface console 0
[Huawei-ui-console0]authentication-mode aaa       //激活配置

5.保存交换机配置(注意:只能在用户模式下配置)

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

6.恢复设备出厂默认值

<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            //是否擦除,回答y
......

<Huawei>reboot                      //重启设备
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:n                 //提示是否再次保存,选择n
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y           //是否重启,选择y
......

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

工作原理:
学习,MAC地址表是交换机通过学习接收的数据帧的源MAC地址来形成的
广播,如果目标地址在MAC地址表中没有,交换机就向除接收到该数据帧的接口外的其他所有接口广播该数据帧
转发,交换机根据MAC地址表单播转发数据帧
更新,交换机MAC地址表的老化时间是300秒,交换机如果发现一个帧的入接口和MAC地址表中源MAC地址的所在接口不同,交换机将MAC 地址重新学习到新的接口
在这里插入图片描述
使用pc的命令界面用ping命令发起对其他pc机的访问

查看交换机Mac地址表

扫描二维码关注公众号,回复: 12876828 查看本文章
[Huawei]display mac-address 

猜你喜欢

转载自blog.csdn.net/gao_2109/article/details/103181538