網絡工程師Day7–本地AAA配置
學習目標
掌握本地AAA認證授權方案的配置方法
掌握創建域的方法
掌握認證用戶優先級的配置方法
拓撲圖
場景
需要對企業服務器的資源訪問進行控制,只有通過
認證的用戶才能訪問特定的資源,因此您需要在R1和R3兩臺路由器上配置本地AAA認證,並基於域來對用戶進行管理,並配置已認證用戶的權限級別
操作步驟
步驟一 實驗環境準備
R1
ip add 119.84.111.1 24
R3
ip add 119.84.111.3 24
步驟二 測試R1與R3之間的連通性
步驟三 在R1上配置AAA功能
aaa
authentication-scheme auth1
authentication-mode local
quit
authorization-scheme auth2
authorization-mode local
quit
在R1上創建 huawei 並將認證方案和授權方案與域關聯起來,然後創建一個用戶並將用戶加入到域huawei
[r1]telnet server enable
Info: The Telnet server has been enabled.
[r1]aaa
[r1-aaa]domain huawei
Info: Success to create a new domain.
[r1-aaa-domain-huawei]authentication-scheme auth1
[r1-aaa-domain-huawei]authorization-scheme auth2
[r1-aaa-domain-huawei]quit
[r1-aaa]local-user user1@huawei password cipher huawei123
Info: Add a new user.
[r1-aaa]local-user user1@huawei service-type telnet
[r1-aaa]local-user user1@huawei privilege level 0
將R1配置爲Telnet服務器,認證模式配置爲AAA
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
驗證telnet R1時是否要經過AAA認證
<r3>telnet 119.84.111.1
Trying 119.84.111.1 ...
Press CTRL+K to abort
Connected to 119.84.111.1 ...
Login authentication
Username:
Username:user1@huawei
Password:
Error: Failed to send authen-req.
Username:
Username:user1@huawei
Password:
Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2019-08-27 00:14:28.
<r1>sys
^
Error: Unrecognized command found at '^' position.
可以看到用戶user1@huawei Telnet R1後不能使用命令system-view進入系統視圖,原因是用戶操作權限配置爲級別0,因此操作受限。
步驟五 在R3上配置AAA功能
在R3上配置認證方案爲本地認證,授權方案爲本地授權
[r3]aaa
[r3-aaa]authentication-scheme auth1
[r3-aaa-authen-auth1]authentication-mode local
[r3-aaa-authen-auth1]quit
[r3-aaa]authorization-scheme auth2
Info: Create a new authorization scheme.
[r3-aaa-author-auth2]authorization-mode local
[r3-aaa-author-auth2]quit
在R3上創建域 huawei 並將認證方案和授權方案與域關聯起來,然後創建一個用戶並將用戶加入到域Huawei。
配置同R1
步驟六 驗證AAA的配置結果
<r1>dis domain name huawei
Domain-name : huawei
Domain-state: Active
Authentication-scheme-name : auth1
Accounting-scheme-name : default
Authorization-scheme-name : auth2
Service-scheme-name : -
RADIUS-server-template : -
HWTACACS-server-template: -
User-group : -
<r1>dis local-user username user1@huawei
The contents of local user(s):
Password : ****************
State : active
Service-type-mask : T
Privilege level : 0
Ftp-directory : -
Access-limit : -
Accessed-num : 0
Idle-timeout : -
User-group: -