[R2]aaa
[R2-aaa]authentication-scheme a1 //配置認證方案a1,採用本地認證
[R2-aaa-authen-a1]authentication-mode local
[R2-aaa-authen-a1]quit
[R2-aaa]authorization-scheme a2 //配置授權方案a2,採用本地授權
[R2-aaa-author-a2]authorization-mode local
[R2-aaa-author-a2]quit
[R2-aaa]domain huawei //創建域,添加認證方案a1、授權方案a2
[R2-aaa-domain-huawei]authentication-scheme a1
[R2-aaa-domain-huawei]authorization-scheme a2
[R2-aaa-domain-huawei]quit
[R2-aaa]local-user huawei@huawei password cipher huawei123 //創建用戶名(所屬域)及密碼
[R2-aaa]local-user huawei@huawei service-type telnet //配置服務類型
[R2-aaa]local-user huawei@huawei privilege level 2 //配置權限級別
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa