The configuration examples refer to the applications of local authentication and authorization on the actual network.
As shown in Figure 1, the administrator admin@aaa logs in to the router through Telnet and uses local authentication and authorization. The admin@aaa user can execute all AAA command lines. The user, however, can only view ACL command lines and cannot configure ACL command lines.
Configure local user authentication and authorization as follows:
Configure the task group and add tasks of the corresponding module.
Configure the user group, bind the corresponding task group, and bind the user group to a domain.
Configure the user and specify the user group of the user.
Configure the user authentication and authorization modes.
To complete the configuration, you need the following data:
Task group name
User group name
Domain name
# Create a task group.
<HUAWEI> system-view [~HUAWEI] aaa [~HUAWEI-aaa] task-group admin
# Add AAA read-write tasks and ACL read-only tasks to the task group.
[*HUAWEI-aaa-task-group-admin] task aaa execute write read [*HUAWEI-aaa-task-group-admin] task acl read [*HUAWEI-aaa-task-group-admin] task config read write execute debug [*HUAWEI-aaa-task-group-admin] commit [~HUAWEI-aaa-task-group-admin] quit
Create a user group.
[~HUAWEI-aaa] user-group admin
# Bind the task group to the user group.
[*HUAWEI-aaa-user-group-admin] task-group admin [*HUAWEI-aaa-user-group-admin] commit [~HUAWEI-aaa-user-group-admin] quit
# Configure a local authentication scheme.
[~HUAWEI-aaa] authentication-scheme localtype [*HUAWEI-aaa-authen-localtype] authentication-mode local [*HUAWEI-aaa-authen-localtype] commit [~HUAWEI-aaa-authen-localtype] quit
# Configure a local authorization scheme.
[~HUAWEI-aaa] authorization-scheme localtype [*HUAWEI-aaa-author-localtype] authorization-mode local [*HUAWEI-aaa-author-localtype] commit [~HUAWEI-aaa-author-localtype] quit
# Reference the authentication and authorization schemes under the domain.
[~HUAWEI-aaa] domain aaa [*HUAWEI-aaa-domain-aaa] authentication-scheme localtype [*HUAWEI-aaa-domain-aaa] authorization-scheme localtype [*HUAWEI-aaa-domain-aaa] commit [~HUAWEI-aaa-domain-aaa] quit
[~HUAWEI-aaa] local-user admin@aaa password cipher Huawei-123 [*HUAWEI-aaa] local-user admin@aaa user-group admin [*HUAWEI-aaa] commit [~HUAWEI-aaa] quit [~HUAWEI] telnet server enable [*HUAWEI] commit
After the preceding configurations are complete, log in to the network through the Telnet. In this case, you can only execute AAA commands and view ACL commands, but you cannot configure the commands.
[~HUAWEI] acl 3000 Error: No permission to run the command.
#
aaa
local-user admin@aaa password cipher %^%#pPgn;|W90$J72.Ak$Y,IQ:gqIfPBTLjqW%,N`M_~%^%#
local-user admin@aaa user-group admin
#
authentication-scheme default
#
authentication-scheme localtype
#
authorization-scheme default
#
authorization-scheme localtype
#
accounting-scheme default
#
domain default
#
domain aaa
authentication-scheme localtype
authorization-scheme localtype
#
task-group admin
task acl read
task aaa read write execute
task config read write execute debug
#
user-group admin
task-group admin
#
interface GigabitEthernet0/1/16
undo shutdown
ip address 10.137.217.251 255.255.254.0
#
ip route-static 0.0.0.0 0.0.0.0 10.137.216.1
#
user-interface vty 0 4
authentication-mode aaa
return