拓扑
代码
R1
<Huawei>sys //进入系统视角
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable //关闭路由器信息表
Info: Information center is disabled.
[Huawei]sysname R1 //修改用户名
[R1]interface g0/0/0 //进入0/0/0接口
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24 //配置IP
[R1-GigabitEthernet0/0/0]undo shutdown //打开接口
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]quit
[R1]quit
R2
[Huawei]undo info-center enable //关闭路由输出信息
Info: Information center is disabled.
[Huawei]sysname R2
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.2 24 //配置IP
[R2-GigabitEthernet0/0/1]undo shutdown //打开接口
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]quit
[R2]aaa //进入AAA视图
[R2-aaa]authentication-scheme hcial //创建认证方案hcia1
Info: Create a new authentication scheme.
[R2-aaa-authen-hcial]authentication-mode local //本地认证
[R2-aaa-authen-hcial]quit
[R2-aaa]authorization-scheme hcia2 //hcia2
Info: Create a new authorization scheme.
[R2-aaa-author-hcia2]authorization-mode local //本地授权
[R2-aaa-author-hcia2]quit
[R2-aaa]quit
[R2-aaa]domain hcia //创建域hcia
Info: Success to create a new domain.
[R2-aaa-domain-hcia]authentication-scheme hcia1 //指定为hcia1认证
[R2-aaa-domain-hcia]authorization-scheme hcia2 //指定为hcia2授权
[R2-aaa-domain-hcia]quit
[R2-aaa]local-user ly@hcia password cipher 1234 //用户名为ly,密码为1234,hcia域
[R2-aaa]local-user ly@hcia service-type telnet //服务类型为talnet
[R2-aaa]local-user ly@hcia privilege level 3 //用户权限为3
[R2-aaa]quit
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa //AAA认证模式
[R2-ui-vty0-4]quit