交换机基本配置

默认配置下,交换机所有接口都属于 vlan 1,接口类型都为 hybrid 型,所有接口都可用。

(1)配置交换机设备名称、管理 vlan 和 Telnet

<Huawei>                          //用户视图提示符
<Huawei>sys                    //进入系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Switch1                 //修改设备名称为SW1
[Switch1]vlan 5                                   //创建交换机VLAN 5
[Switch1-vlan5]management-vlan      //设置管理 VLAN 5
[Switch1-vlan5]q                                 //退出vlan 视图
[Switch1]int vlanif 5                            //创建交换机管理VLAN的vlanif 接口
[Switch1-Vlanif5]ip address 10.10.1.1 24             //配置vlanif 接口IP地址
[Switch1-Vlanif5]q                                  //退出vlanif接口视图
[Switch1]telnet server enable                //Telent默认是关闭的,需要打开
Info: The Telnet server has been enabled.
[Switch1]user-int vty 0 4                            //开启vty线路模式
[Switch1-ui-vty0-4]protocol inbound telnet             //配置Telent协议
[Switch1-ui-vty0-4]authentication-mode aaa            //配置aaa认证方式
[Switch1-ui-vty0-4]q
[Switch1]aaa          // 进入aaa配置视图
[Switch1-aaa]local-user admin password cipher adad       //配置用户名和密码
[Switch1-aaa]local-user admin privilege level 15            //设置用户权限等级为15级

[Switch1-aaa]q                                       
[Switch1]q
<Switch1>save                              //在用户视图下保存

 

posted @ 2025-11-18 09:14  chao_xiong  阅读(12)  评论(0)    收藏  举报