【菜鳥IT大講堂】實驗分享-本地AAA配置

溫馨提示:歡迎對技術感興趣的新手朋友們,希望這些知識點能對大家有幫助。如果有什麼不解或疑惑或建議,可留言小編或郵件[email protected],我將盡快給予解決。感謝大家的支援和關注,謝謝!!!

【菜鳥IT大講堂】實驗分享-本地AAA配置

學習目標

· 掌握本地AAA認證授權方案的配置方法

· 掌握建立域的方法

· 掌握認證使用者優先順序的配置方法

拓撲圖

【菜鳥IT大講堂】實驗分享-本地AAA配置

圖7。3 本地AAA配置實驗拓撲圖

場景

您是企業的網路管理員,需要對企業伺服器的資源訪問進行控制,只有透過認證的使用者才能訪問特定的資源,因此您需要在R1路由器上配置本地AAA認證,並基於域來對使用者進行管理,並配置已認證使用者的許可權級別。

操作步驟

步驟一 實驗環境準備

為了保證實驗結果的準確性,確保裝置以空配置啟動。

配置R1

system-view

[Huawei]sysname R1

[R1]interface GigabitEthernet0/0/0

[R1-GigabitEthernet0/0/0]ip address 10。1。12。1 24

配置R2

system-view

[Huawei]sysname R2

[R2]interface GigabitEthernet0/0/0

[R2-GigabitEthernet0/0/0]ip address 10。1。12。2 24

步驟二 檢測R1和R2間的連通性

ping 10。1。12。2

PING 10。1。12。2: 56 data bytes, press CTRL_C to break

Reply from 10。1。12。2: bytes=56 Sequence=1 ttl=255 time=100 ms

Reply from 10。1。12。2: bytes=56 Sequence=2 ttl=255 time=30 ms

Reply from 10。1。12。2: bytes=56 Sequence=3 ttl=255 time=20 ms

Reply from 10。1。12。2: bytes=56 Sequence=4 ttl=255 time=30 ms

Reply from 10。1。12。2: bytes=56 Sequence=5 ttl=255 time=30 ms

步驟三 在R1上配置AAA功能

在R1上配置認證方案為本地認證,授權方案為本地授權。

[R1]aaa

[R1-aaa]authentication-scheme auth1

[R1-aaa-authen-auth1]authentication-mode local

[R1-aaa-authen-auth1]quit

[R1-aaa]authorization-scheme auth2

[R1-aaa-author-auth2]authorization-mode local

[R1-aaa-author-auth2]quit

在R1上建立域“huawei“並將認證方案和授權方案與域關聯起來,然後建立一個使用者並將使用者加入到域huawei。

[R1]telnet server enable

[R1]aaa

[R1-aaa]domain huawei

[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

[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

驗證R2 Telnet R1時是否要經過AAA認證。

telnet 10。1。12。1

Press CTRL_] to quit telnet mode

Trying 10。1。12。1 。。。

Connected to 10。1。12。1 。。。

Login authentication

Username:user1@huawei

Password: 輸入密碼huawei123

system-view

^

Error: Unrecognized command found at ‘^’ position。

quit

可以看到使用者user1@huawei Telnet R1後不能使用命令

system-view

進入系統試圖,原因是使用者操作許可權配置的是級別0,因此操作受限。

步驟四 驗證AAA的配置結果

display 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 : -

display 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 : -

配置檔案

display current-configuration