AAA Configuration Examples
AAA Configuration Examples
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a RADIUS server template.
2. Configure an authentication scheme and an accounting scheme.
3. Apply the RADIUS server template, authentication scheme, and accounting
scheme to the domain.
NOTE:
Perform the following configurations only on Switch B.
Procedure
1. Configure a RADIUS server template.
# Configure a RADIUS template shiva.
<HUAWEI> system-view
[HUAWEI] radius-server template shiva
# Set the key and retransmission count for the RADIUS server, and configure
the device not to encapsulate the domain name in the user name when sending
RADIUS packets to a RADIUS server.
[HUAWEI-radius-shiva] radius-server shared-key cipher hello
[HUAWEI-radius-shiva] radius-server retransmit 2
[HUAWEI-radius-shiva] undo radius-server user-name domain-
included
[HUAWEI-radius-shiva] quit
# Configure the accounting scheme abc that uses RADIUS accounting and the
policy that the device is kept online when accounting fails.
[HUAWEI-aaa] accounting-scheme abc
[HUAWEI-aaa-accounting-abc] accounting-mode radius
[HUAWEI-aaa-accounting-abc] accounting start-fail online
[HUAWEI-aaa-accounting-abc] quit
NOTE:
After the domain huawei is configured, if a user enters the user name in the format of
user@huawei, the device authenticates the user in the domain huawei. If the user name does
not contain the domain name or the domain name in the user name does not exist, the device
authenticates the user in the default domain.
The domain that a user belongs to depends on the RADIUS client but not the RADIUS server.
After the undo radius-server user-name domain-included command is executed
on SwitchB, SwitchB sends the user name without the domain name to the RADIUS server
when receiving the user name in the format of user@huawei. However, SwitchB places the
user in the domain huawei for authentication.
Shared-secret-key :
%$%$1"y;E[c;<.(_RS/w*!`IOxof%$%$
Timeout-interval(in second) : 5
Retransmission : 2
EndPacketSendTime : 0
Dead time(in minute) : 5
Domain-included : NO
NAS-IP-Address : 0.0.0.0
Calling-station-id MAC-format : xxxx-xxxx-xxxx
Server algorithm : master-backup
Authentication Server 1 : 10.7.66.66 Port:1812
Weight:80
Vrf:- LoopBack:NULL
Source IP: ::
Authentication Server 2 : 10.7.66.67 Port:1812
Weight:40
Vrf:- LoopBack:NULL
Source IP: ::
Accounting Server 1 : 10.7.66.66 Port:1813
Weight:80
Vrf:- LoopBack:NULL
Source IP: ::
Accounting Server 2 : 10.7.66.67 Port:1813
Weight:40
Vrf:- LoopBack:NULL
Source IP: ::
-------------------------------------------------------------
-----------------
Configuration Files
Configuration files on Switch B
#
radius-server template shiva
radius-server shared-key cipher %$%$1"y;E[c;<.(_RS/w*!`IOxof%$%$
radius-server authentication 10.7.66.66 1812 weight 80
radius-server authentication 10.7.66.67 1812 weight 40
radius-server accounting 10.7.66.66 1813 weight 80
radius-server accounting 10.7.66.67 1813 weight 40
radius-server retransmit 2
undo radius-server user-name domain-included
#
aaa
authentication-scheme auth
authentication-mode radius local
accounting-scheme abc
accounting-mode radius
accounting start-fail online
domain huawei
authentication-scheme auth
accounting-scheme abc
HCIA-Datacom MksU
radius-server shiva
local-user user1 password cipher %$%$1"y;E[c;<.(_RS/w*!`IOxof%$%$
local-user user1 privilege level 15
local-user user1 service-type http
aaa
authentication-scheme auth
authentication-mode radius local
accounting-scheme abc
accounting-mode radius
accounting start-fail online
domain huawei
authentication-scheme auth
accounting-scheme abc
radius-server shiva
#
return
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an HWTACACS server template.
2. Configure authentication, authorization, and accounting schemes.
3. Apply the HWTACACS server template, authentication scheme, authorization
scheme, and accounting scheme to the domain.
NOTE:
Perform the following configurations only on SwitchB.
Procedure
1. Enable HWTACACS.
2. <HUAWEI> system-view
[HUAWEI] hwtacacs enable
NOTE:
The HWTACACS function is enabled by default. If the HWTACACS configuration has not
been modified, you do not need to run this command.
Run the display domain command on SwitchB, and you can see that the
configuration of the domain meets the requirements.
<HUAWEI> display domain name huawei
HCIA-Datacom MksU
Domain-name : huawei
Domain-state : Active
Authentication-scheme-name : l-h
Accounting-scheme-name : hwtacacs
Authorization-scheme-name : hwtacacs
Service-scheme-name : -
RADIUS-server-template : -
HWTACACS-server-template : ht
User-group : -
Push-url-address : -
Configuration Files
Configuration files on Switch B
#
domain huawei admin
#
hwtacacs-server template ht
hwtacacs-server authentication 10.7.66.66
hwtacacs-server authentication 10.7.66.67 secondary
hwtacacs-server authorization 10.7.66.66
hwtacacs-server authorization 10.7.66.67 secondary
hwtacacs-server accounting 10.7.66.66
hwtacacs-server accounting 10.7.66.67 secondary
hwtacacs-server shared-key cipher %$%$|)<+J>dN>=IqD<gO/Fj$xo%$%$
#
aaa
authentication-scheme default
authentication-scheme l-h
authentication-mode hwtacacs local
authorization-scheme default
authorization-scheme hwtacacs
authorization-mode hwtacacs local
accounting-scheme default
accounting-scheme hwtacacs
accounting-mode hwtacacs
accounting realtime 3
accounting start-fail online
domain default
domain default_admin
domain huawei
authentication-scheme l-h
authorization-scheme hwtacacs
accounting-scheme hwtacacs
hwtacacs-server ht
local-user user1 password irreversible-cipher
%$%$@'}9B*+FN![}%57+_t|EU"bk%@%@
local-user user1 privilege level 15
local-user user1 service-type http
HCIA-Datacom MksU
#
return
Configuration Roadmap
The configuration roadmap is as follows:
1. Create a VLAN and a VLANIF interface so that SwitchB can communicate
with the RADIUS server.
2. Configure authentication and accounting schemes for common users and apply
the schemes to the default domain to authenticate common users such as users
using 802.1x or Portal authentication. The user names of the users do not carry
domain names.
3. Configure authentication and authorization schemes for the administrator user
and apply the schemes to the default_admin domain to authenticate the
administrator user such as the user logging in through Telnet, SSH, or FTP.
The user name of the administrator user does not carry the domain name.
HCIA-Datacom MksU
NOTE:
Ensure that the RADIUS server address, port number, and shared key in the RADIUS server template are the same
as the settings on the RADIUS server.
Ensure that users have been configured on the RADIUS server. In this example, a user with the user name test1 and
password 123456 has been configured on the RADIUS server.
This example provides only the configuration of SwitchB. The configurations of SwitchA and the RADIUS server
are not mentioned here.
Procedure
1. Create a VLAN and configure an interface.
# Create VLAN 11 on SwitchB.
<HUAWEI> system-view
[HUAWEI] vlan batch 11
# Test the connection between SwitchB and the RADIUS server. The test
user test1 with password 123456 has been configured on the RADIUS server.
[HUAWEI-aaa] test-aaa test1 123456 radius-template rd1
Info: Account test succeed.
# Set the global default domain for common users to default. After common
users enter their user names in the format of user@default, the device performs
AAA authentication on these users in the default domain. If a user name does
not contain a domain name or the domain name does not exist, the device
authenticates the common user in the default common domain.
[HUAWEI] domain default
3. Configure local authentication and authorization for the administrator user test.
# Configure the device to use AAA for the Telnet user that logs in through the
VTY user interface.
[HUAWEI] user-interface vty 0 14
[HUAWEI-ui-vty0-14] authentication-mode aaa
[HUAWEI-ui-vty0-14] quit
# Configure a local user named test with password admin@12345 and user
level 3.
[HUAWEI] aaa
[HUAWEI-aaa] local-user test password irreversible-cipher
admin@12345 privilege level 3
# Configure local account locking, and set the retry count to 5 minutes,
consecutive authentication failure count to 3, and local account locking
duration to 5 minutes.
[HUAWEI-aaa] local-aaa-user wrong-password retry-interval 5
retry-time 3 block-time 5
When common users go online and enter the user name test1 and
password 123456 on the 802.1x client, run the display access-user
domain and display access-user user-id commands. You can view the domain
that users belong to and the access type.
<HUAWEI> display access-user domain default
--------------------------------------------------------------
----------------
UserID Username IP address
MAC
--------------------------------------------------------------
----------------
16040 test1 -
00e0-4c97-31f6
--------------------------------------------------------------
----------------
Total 1,1 printed
<HUAWEI> display access-user user-id 16040
Bsic:
User ID : 16040
User name : test1
Domain-name : default
User MAC : 00e0-4c97-31f6
User IP address : -
User access time : 2009/02/15 19:10:52
User accounting session ID : 255255000000000f910d2016040
Option82 information : -
User access type : 802.1x
AAA:
User authentication type : 802.1x authentication
Current authentication method : RADIUS
Current authorization method : -
Current accounting method : RADIUS
When the user logs in through Telnet and enters the user name test and
password admin@12345, run the display access-user domain and display
HCIA-Datacom MksU
access-user user-id commands. You can view the domain that the user belongs
to and the access type.
<HUAWEI> display access-user domain default_admin
--------------------------------------------------------------
----------------
UserID Username IP address
MAC
--------------------------------------------------------------
----------------
16009 test 10.135.18.217
-
--------------------------------------------------------------
----------------
Total 1,1 printed
<HUAWEI> display access-user user-id 16009
Basic:
User ID : 16009
User name : test
Domain-name : default_admin
User MAC : -
User IP address : 10.135.18.217
User access time : 2009/02/15 05:10:52
User accounting session ID :
HUAWEI255255000000000f910d2016009
User access type : Telnet
AAA:
User authentication type : Administrator
authentication
Current authentication method : Local
Current authorization method : Local
Current accounting method : None
Configuration File
Configuration file of SwitchB
#
vlan batch 10 11
#
dot1x enable
#
radius-server template rd1
radius-server shared-key cipher %$%$lrWRXXUmJ/5W\uBqID/6EULC%$%$
radius-server authentication 192.168.2.30 1812
radius-server accounting 192.168.2.30 1813
radius-server retransmit 2
#
aaa
authentication-scheme auth
authentication-scheme abc
HCIA-Datacom MksU
authentication-mode radius
authorization-scheme autho
accounting-scheme abc
accounting-mode radius
domain default
authentication-scheme abc
accounting-scheme abc
domain default_admin