华为路由器/交换机配置Console口AAA认证以及Telnet登录

一、Console 口登录 

Console 口是路由器/交换机的本地管理接口,通常用于设备初始配置和管理。本文将介绍console登录的两种配置方式

1、密码模式

配置成这种模式后Console登录只需要输入密码。

配置方法一

[Huawei]user-interface console 0 
[Huawei-ui-console0]authentication-mode password 
Please configure the login password (maximum length 16):Huawei@123
[Huawei-ui-console0]q
[Huawei]q
q

  Configuration console exit, please press any key to log on


Login authentication


Password:

直接进入设备的Console口视图,将登录密码改为Huawei@123,注意这里的最大字符为16位。

配置方法二

[Huawei]user-interface console 0	
[Huawei-ui-console0]set authentication password cipher ?
  STRING<1-16>/<56>  Cipher text password
[Huawei-ui-console0]set authentication password cipher Huawei@123
[Huawei-ui-console0]q
[Huawei]q
q

  Configuration console exit, please press any key to log on


Login authentication


Password:

配置完之后退出用户视图即可验证,输入对应的密码才能使用Console口本地登录该设备。

2、AAA认证模式

现在介绍的是配置AAA模式的Console口登录,也是进入Console的接口视图,将认证模式改为AAA模式,然后进入AAA视图创建一个对应的账号并给予权限等级为15,对应的Code如下:

[Huawei]user-interface con 0
[Huawei-ui-console0]authentication-mode aaa
[Huawei-ui-console0]aaa
[Huawei-aaa]local-user admin password cipher Huawei@123	
[Huawei-aaa]local-user admin privilege level 15
[Huawei-aaa]q
[Huawei]q

q

  Configuration console exit, please press any key to log on


Login authentication


Username:admin
Password:

二、Telnet远程登录

接下来配置的是Telnet远程登录,与Console口登录不同,Telnet远程登录是一种跨设备登录的方式。需要IP地址寻址作为登录的前提。因此要先配置IP地址,拓扑图如下:

华为路由器/交换机配置Console口AAA认证以及Telnet登录_第1张图片

先配置好设备对应的物理接口IP地址:

AR1:
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]
[AR1-GigabitEthernet0/0/0]ip add 10.0.0.1 30

AR2:
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]
[AR2-GigabitEthernet0/0/0]ip add 10.0.0.2 30

Telnet登录也分为密码登录和AAA认证登录,下面依次进行演示。

1、密码模式

该模式只需要输入密码,不需要输入账号名。

在AR1上配置Telnet远程登录密码为:Huawei@123

[AR1]user-interface vty 0 4
[AR1-ui-vty0-4]user privilege level 15 
[AR1-ui-vty0-4]
[AR1-ui-vty0-4]authentication-mode password 
Please configure the login password (maximum length 16):Huawei@123

在AR2上验证Telnet远程登录:

telnet 10.0.0.1
  Press CTRL_] to quit telnet mode
  Trying 10.0.0.1 ...
  Connected to 10.0.0.1 ...

Login authentication


Password:

2、AAA认证模式

该模式需要输入账号名和密码。

先进入虚拟终端接口视图,将认证模式改为AAA认证,然后再进入AAA视图创建对应的本地账户u1,配置密码为Huawei@123,需要注意的是这里要将账户的服务类型改为Telnet类型,不然该账户就是默认Console口登录。

[AR1]user-interface vty 0 4
[AR1-ui-vty0-4]authentication-mode aaa  
[AR1-ui-vty0-4]aaa  
[AR1-aaa]
[AR1-aaa]local-user u1 password cipher Huawei@123
Info: Add a new user.
[AR1-aaa]local-user u1 privilege level 15 
[AR1-aaa]local-user u1 service-type telnet  

 现在就可以进入AR2路由器的CLI界面使用对应的账户登录进AR1路由器。

telnet 10.0.0.1 
  Press CTRL_] to quit telnet mode
  Trying 10.0.0.1 ...
  Connected to 10.0.0.1 ...

Login authentication


Username:u1
Password:

你可能感兴趣的:(信息与通信,网络协议)