华为/华三交换机配置console登陆密码及telnet AAA登陆验证

原创 阁主  2021-10-16 15:07:37  阅读 14066 次 评论 4 条
摘要:

华三和华为的设备配置命令都是一样的,基本上不会有很大的差别,本文使用的是华为的Ensp模拟器,由于华为模拟器的PC不支持telnet命令,组网图就准备了两台交换机来互相telnet对方进行检查实验配置的有效性。

组网拓扑

组网拓扑使用了两台S3700交换机作为本次实验设备,设备要实现的功能都在图中标注了。

组网拓扑.png

配置思路

仅仅是为了实现简单的console和telnet登陆验证的功能,就不做任何vlan添加和接口配置,就默认使用vlan1进行配置,保证两边设备IP都配置在同一网段下即可。

配置命令

LSW1设备配置:

快捷copy:

  1. sys
  2. sysname LSW1
  3. int vlan 1
  4. ip add 192.168.1.1 24
  5. quit
  6. user-interface console 0
  7. authentication-mode password
  8. set authentication password cipher 123456
  9. return
  10. save
  11. Y

详解命令:

  1. #用户视图切换系统视图
  2. <Huawei>sys
  3. #修改设备名
  4. [Huawei]sysname LSW1
  5. #进入vlan1虚拟口
  6. [LSW1]int vlan 1
  7. #给虚拟vlan配置IP
  8. [LSW1-Vlanif1]ip add 192.168.1.1 24
  9. #返回上一级(系统视图)
  10. [LSW1-Vlanif1]quit
  11. #进入console配置端口
  12. [LSW1]user-interface console 0
  13. #认证模式为密码认证
  14. [LSW1-ui-console0]authentication-mode password
  15. #配置密码为密文加密123455
  16. [LSW1-ui-console0]set authentication password cipher 123456
  17. #返回用户视图
  18. [LSW1-ui-console0]return
  19. #保存配置
  20. <LSW1>save

LSW2设备配置:

快捷copy:

  1. sys
  2. sysname LSW2
  3. int vlan 1
  4. ip add 192.168.1.2 24
  5. quit
  6. user-interface console 0
  7. authentication-mode aaa
  8. quit
  9. user-interface vty 0 4
  10. authentication-mode aaa
  11. aaa
  12. local-user admin password cipher 123456
  13. local-user admin privilege level 15 
  14. local-user admin service-type telnet terminal
  15. return
  16. save
  17. Y

详解命令:

  1. #进入系统视图
  2. <LSW2>sys
  3. #修改设备名
  4. [LSW2]sysname LSW2
  5. #进入vlan1端口
  6. [LSW2]int vlan 1
  7. #配置vlan1端口ip
  8. [LSW2-Vlanif1]ip add 192.168.1.2 24
  9. #返回上一级(系统视图)
  10. [LSW2-Vlanif1]quit
  11. #进入console端口
  12. [LSW2]user-interface console 0
  13. #配置console验证模式为AAA
  14. [LSW2-ui-console0]authentication-mode aaa
  15. #返回上一级(系统视图)
  16. [LSW2-ui-console0]quit
  17. #进入虚拟终端配置(0-4为同时支持5终端接入)
  18. [LSW2]user-interface vty 0 4
  19. #终端验证模式为AAA
  20. [LSW2-ui-vty0-4]authentication-mode aaa
  21. #进入AAA用户方案模板
  22. [LSW2-ui-vty0-4]aaa
  23. #配置添加用户和密文密码
  24. [LSW2-aaa]local-user admin password cipher 123456
  25. #配置用户管理等级为最高15
  26. [LSW2-aaa]local-user admin privilege level 15
  27. #配置用户授权登陆模式同时支持telnet、terminal模式(没有terminal会无法进入本机配置命令)
  28. [LSW2-aaa]local-user admin service-type telnet terminal
  29. #返回用户视图
  30. [LSW2-aaa]return
  31. #保存配置命令
  32. <LSW2>save

成果检测

LSW1使用telnet命令连接登陆LSW2:

LSW1-LSW2.png

临时拖出一台PC使用console连接LSW1交换机查看配置console端口密码是否生效:

console口登陆.png临时的PC机使用console口接到LSW2上,测试console登陆是否使用AAA认证:

console口登陆lsw2.png

拓扑下载

点我下载本文拓扑文件

本文地址:https://www.mainblog.cn/265.html
版权声明:本文为原创文章,版权归 阁主 所有,欢迎分享本文,转载请保留出处!
免责申明:有些内容源于网络,没能联系到作者。如侵犯到你的权益请告知,我们会尽快删除相关内容。

评论已关闭!