1. 程式人生 > >ACS對接華為 配置筆記

ACS對接華為 配置筆記

#配置管理員登入方式及認證方式。
[SwitchA] user-interface maximum-vty 3 //配置遠端登入交換機的管理員最大數目為3
[SwitchA] user-interface vty 0 2 //進入3個管理員介面檢視
[SwitchA-ui-vty0-2] authentication-mode aaa //配置管理員的認證方式為AAA
[SwitchA-ui-vty0-2] protocol inbound ssh //配置管理員的遠端登入協議為SSH,即管理員必須通過Stelnet方式登入裝置
[SwitchA-ui-vty0-2] quit

#配置本地SSH使用者,以admin為例
[SwitchA] stelnet server enable

//開啟交換機的STelnet服務
[SwitchA] ssh authentication-type default password //配置SSH使用者預設採用密碼認證
[SwitchA] ssh user admin //建立本地SSH使用者admin
[SwitchA] ssh user admin authentication-type password //配置admin使用者的認證方式為密碼認證
[SwitchA] ssh user admin service-type stelnet //配置admin使用者的登入方式為STelnet
[SwitchA] aaa
[SwitchA-aaa] local-user admin password irreversible-cipher
[email protected]
//配置本地管理員admin的密碼為[email protected],作為ACS異常的本地備份
[SwitchA-aaa] local-user admin privilege level 0 //配置admin的使用者級別為0
[SwitchA-aaa] local-user admin service-type ssh //配置admin的登入協議為SSH
[SwitchA-aaa] quit

一、交換機配置
配置管理員使用者進行認證時SwitchA與ACS的對接引數。

1.建立管理員進行認證時採用的HWTACACS伺服器模板hw
[SwitchA] hwtacacs-server template hw


[SwitchA-hwtacacs-hw] hwtacacs-server authentication 192.168.100.1 //指定ACS作為HWTACACS認證伺服器
[SwitchA-hwtacacs-hw] hwtacacs-server authorization 192.168.100.1 //指定ACS作為HWTACACS授權伺服器
[SwitchA-hwtacacs-hw] hwtacacs-server accounting 192.168.100.1
//指定ACS作為HWTACACS計費伺服器*
[SwitchA-hwtacacs-hw] hwtacacs-server shared-key cipher [email protected] //配置SwitchA與ACS通訊的HWTACACS共享金鑰為[email protected]
[SwitchA-hwtacacs-hw] undo hwtacacs-server user-name domain-included //配置SwitchA向ACS傳送的報文中的管理員使用者名稱不包含域名
[SwitchA-hwtacacs-hw] quit

2.建立認證方案hw
[SwitchA] aaa
[SwitchA-aaa] authentication-scheme hw
[SwitchA-aaa-authen-hw] authentication-mode hwtacacs local
//配置認證方式為HWTACACS,並配置本地認證方式作為備份
[SwitchA-aaa-authen-hw] quit

3.建立授權方案hw
[SwitchA-aaa] authorization-scheme hw
[SwitchA-aaa-author-hw] authorization-mode hwtacacs local
//配置授權方式為HWTACACS,並配置本地授權方式作為備份
[SwitchA-aaa-author-hw] authorization-cmd 0 hwtacacs
//配置級別為0的使用者按命令列授權,授權方式為HWTACACS授權,可根據實際需求對指定級別的使用者進行該配置
[SwitchA-aaa-author-hw] quit
4.建立計費方案hw
[SwitchA-aaa] accounting-scheme hw
[SwitchA-aaa-accounting-hw] accounting-mode hwtacacs //配置計費方案為HWTACACS方式
[SwitchA-aaa-accounting-hw] accounting start-fail online //配置當開始計費失敗時,允許使用者上線
[SwitchA-aaa-accounting-hw] quit

5.建立記錄方案hw
[SwitchA-aaa] recording-scheme hw
[SwitchA-aaa-recording-hw] recording-mode hwtacacs hw //配置記錄方案通過HWTACACS伺服器模板hw將記錄的資訊傳送給ACS
[SwitchA-aaa-recording-hw] quit
[SwitchA-aaa] cmd recording-scheme hw //記錄使用者在裝置上執行過的命令

6.建立管理員的認證域hw
[SwitchA-aaa] domain hw
[SwitchA-aaa-domain-hw] authentication-scheme hw //指定認證方案為hw
[SwitchA-aaa-domain-hw] accounting-scheme hw //指定計費方案hw
[SwitchA-aaa-domain-hw] authorization-scheme hw //指定授權方案為hw
[SwitchA-aaa-domain-hw] hwtacacs-server hw //指定HWTACACS伺服器模板為hw
[SwitchA-aaa-domain-hw] quit
[SwitchA-aaa] quit

7.配置對管理員使用者進行認證。
[SwitchA] domain hw admin //配置hw域為交換機的預設管理認證域,所有的管理員使用者登入到交換機時自動在該域下進行認證

8.配置普通接入使用者進行認證時SwitchA與ACS的對接引數

8.1 將NAC配置模式切換成統一模式
說明:裝置預設為統一模式。傳統模式與統一模式相互切換後,管理員必須儲存配置後重啟裝置,新配置模式的各項功能才能生效。

[SwitchA] authentication unified-mode

8.2 建立RADIUS伺服器模板authentication。
[SwitchA] radius-server template authentication
[SwitchA-radius-authentication] radius-server authentication 192.168.100.1 1812 source ip-address 192.168.50.1 //配置ISE作為認證伺服器
[SwitchA-radius-authentication] radius-server accounting 192.168.100.1 1813 source ip-address 192.168.50.1 //配置ISE作為計費伺服器
[SwitchA-radius-authentication] radius-server shared-key cipher [email protected] //配置RADIUS共享金鑰為[email protected]
[SwitchA-radius-authentication] undo radius-server user-name domain-included //配置裝置向ISE傳送的報文中的使用者名稱為使用者原始輸入的使用者名稱,裝置不對其進行修改
[SwitchA-radius-authentication] calling-station-id mac-format hyphen-split mode2 uppercase //配置RADIUS報文中calling-station-id屬性欄位中MAC地址的封裝格式為xx-xx-xx-xx-xx-xx,並且使用大寫格式
[SwitchA-radius-authentication] radius-attribute set Service-Type 10 auth-type mac //配置MAC認證時RADIUS屬性Service-Type的值為10
[SwitchA-radius-authentication] quit

8.3配置RADIUS授權伺服器。
[SwitchA] radius-server authorization 192.168.100.1 shared-key cipher [email protected]

8.4建立認證方案auth
[SwitchA] aaa
[SwitchA-aaa] authentication-scheme auth
[SwitchA-aaa-authen-auth] authentication-mode radius //配置認證方式為RADIUS
[SwitchA-aaa-authen-auth] quit
8.5建立計費方案acco
為了方便RADIUS伺服器維護帳號的狀態資訊,例如上下線資訊,強制帳號下線,計費模式必須配置為RADIUS。
[SwitchA-aaa] accounting-scheme acco
[SwitchA-aaa-accounting-acco] accounting-mode radius //配置計費方案為RADIUS方式
[SwitchA-aaa-accounting-acco] accounting realtime 3 //配置實時計費週期為3分鐘
[SwitchA-aaa-accounting-acco] quit
8.6建立認證域domain
[SwitchA-aaa] domain domain
[SwitchA-aaa-domain-domain] authentication-scheme auth //指定認證方案為auth
[SwitchA-aaa-domain-domain] accounting-scheme acco //指定計費方案為acco
[SwitchA-aaa-domain-domain] radius-server authentication //指定RADIUS伺服器模板為authentication
[SwitchA-aaa-domain-domain] quit
8.7建立伺服器異常時,對使用者授權採用的業務方案
[SwitchA-aaa] service-scheme down01 //建立對PC和IP話機授權採用的業務方案down01
[SwitchA-aaa-service-down01] user-vlan 30 //配置對PC使用者授權VLAN 30
[SwitchA-aaa-service-down01] voice-vlan //配置對IP話機授權語音VLAN
[SwitchA-aaa-service-down01] quit
[SwitchA-aaa] service-scheme down02 //建立對AP授權採用的業務方案down02
[SwitchA-aaa-service-down02] user-vlan 40 //配置對AP授權VLAN 40
[SwitchA-aaa-service-down02] quit
8.8建立使用者認證失敗時,對其授權採用的業務方案fail
[SwitchA-aaa] service-scheme fail
[SwitchA-aaa-service-fail] user-vlan 50 //配置使用者認證失敗時加入VLAN 50
[SwitchA-aaa-service-fail] quit
[SwitchA-aaa] quit
配置對普通接入使用者進行認證。
8.9 建立802.1X認證接入模板dot1x
說明:
802.1X接入模板預設採用EAP認證方式。請確保RADIUS伺服器支援EAP協議,否則無法處理802.1X認證請求。

[SwitchA] dot1x-access-profile name dot1x
[SwitchA-dot1x-access-profile-dot1x] dot1x reauthenticate //配置對線上802.1X認證使用者進行週期重認證功能
[SwitchA-dot1x-access-profile-dot1x] dot1x timer reauthenticate-period 120 //配置對線上802.1X認證使用者重認證週期為120秒
[SwitchA-dot1x-access-profile-dot1x] authentication event client-no-response action authorize vlan 50 //配置使用者在802.1X客戶端無響應時的加入VLAN 50
[SwitchA-dot1x-access-profile-dot1x] quit
8.10建立IP話機和印表機等啞終端MAC認證接入模板mac
[SwitchA] mac-access-profile name mac
[SwitchA-mac-access-profile-mac] mac-authen reauthenticate //配置對線上MAC認證使用者進行週期重認證功能
[SwitchA-mac-access-profile-mac] mac-authen timer reauthenticate-period 120 //配置對線上MAC認證使用者重認證週期為120秒
[SwitchA-mac-access-profile-mac] quit
8.11建立AP MAC認證接入模板ap_mac
[SwitchA] mac-access-profile name ap_mac
[SwitchA-mac-access-profile-ap_mac] mac-authen username macaddress format without-hyphen //配置AP進行MAC認證的使用者名稱為不帶分隔符的MAC地址格式
[SwitchA-mac-access-profile-ap_mac] quit

8.12配置PC使用者和IP話機的認證模板dot1x&mac
[SwitchA] authentication-profile name dot1x&mac
[SwitchA-authen-profile-dot1x&mac] dot1x-access-profile dot1x //指定802.1X接入模板為dot1x
[SwitchA-authen-profile-dot1x&mac] mac-access-profile mac //指定MAC接入模板為mac
[SwitchA-authen-profile-dot1x&mac] access-domain domain force //配置強制認證域為domain
[SwitchA-authen-profile-dot1x&mac] authentication event authen-fail action authorize service-scheme fail //配置PC使用者和IP話機認證失敗時採用業務方案fail進行授權
[SwitchA-authen-profile-dot1x&mac] authentication event authen-server-down action authorize service-scheme down01 //配置ISE伺服器異常時採用業務方案down01對PC和IP話機進行授權
[SwitchA-authen-profile-dot1x&mac] authentication event authen-server-up action re-authen //配置當ISE恢復正常時,對使用者進行重認證
[SwitchA-authen-profile-dot1x&mac] authentication dot1x-mac-bypass //配置MAC旁路認證功能
[SwitchA-authen-profile-dot1x&mac] quit
8.13配置AP的認證模板ap_auth
[SwitchA] authentication-profile name ap_auth
[SwitchA-authen-profile-ap_auth] mac-access-profile ap_mac //指定MAC接入模板為ap_mac
[SwitchA-authen-profile-ap_auth] access-domain domain force //配置強制認證域為domain
[SwitchA-authen-profile-ap_auth] authentication event authen-fail action authorize service-scheme fail //配置AP認證失敗時採用業務方案fail進行授權
[SwitchA-authen-profile-ap_auth] authentication event authen-server-down action authorize service-scheme down02 //配置ISE伺服器異常時採用業務方案down02對AP進行授權
[SwitchA-authen-profile-ap_auth] authentication event authen-server-up action re-authen //配置當ISE恢復正常時,對使用者進行重認證
[SwitchA-authen-profile-ap_auth] undo authentication handshake //關閉裝置對預連線使用者和已授權使用者之間的握手功能
[SwitchA-authen-profile-ap_auth] authentication mode multi-share //配置交換機與AP相連線口的使用者接入模式為multi-share模式
[SwitchA-authen-profile-ap_auth] quit
說明:
當AP的報文轉發模式為直接轉發模式時,必須配置交換機與AP相連線口的使用者接入認證模式為multi-share模式。

8.14在介面GE0/0/1和GE0/0/2上繫結認證模板dot1x&mac,使能MAC旁路認證。在介面GE0/0/3上繫結認證模板ap_mac,使能MAC認證。
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] authentication-profile dot1x&mac
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] authentication-profile dot1x&mac
[SwitchA-GigabitEthernet0/0/2] quit
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] authentication-profile ap_auth
[SwitchA-GigabitEthernet0/0/3] quit

二、ACS配置
1.登入ACS
2.配置普通接入使用者
2.1 建立組:Users and Identity Stores > Identity Groups”,例如建立了ap_group和pc_group
2.2 建立使用者並加入組:“Users and Identity Stores > Internal Identity Stores > Users”,例如建立了使用者pc1,並加入pc_group
2.3 建立主機並加入組:“Users and Identity Stores > Internal Identity Stores > Hosts”例建立把ap1的mac地址接入到ap_group
2.4 建立群組:“Users and Identity Stores > Identity Groups”,例建立了管理器群組admin
2.5 建立管理員並加入到管理員組:Users and Identity Stores > Internal Identity Stores > Users,例如建立admin並加入到admin組。

3.新增認證裝置
“Network Resources > Network Devices and AAA Clients”,指定ACS與接入裝置之間的互動協議為RADIUS和TACACS

4.配置普通接入使用者授權模板
Policy Elements > Authorization and Permissions > Network Access > Authorization Profiles”,在“Common Tasks”頁籤中指定Vlan 。

5.配置管理員使用者授權模板
Policy Elements > Authorization and Permissions > Device Administration > Shell Profiles”,在“Common Tasks”中的Default Privilege 中指定使用者級別。例如建立level0和level15兩個授權使用者級別。
6.建立授權命令列模板
Policy Elements > Authorization and Permissions > Device Administration > Command Sets”,例如我建立了名稱為L0,允許display ver ,dis dev ,dis men 的許可權,如下圖:
ACS對接華為 配置筆記
建立了名稱為L15,勾選“Permit any command that is not in the table below”,允許所有命令。
7.配置普通接入使用者認證和授權策略
“Access Policies > Access Services”,單擊右側操作區域下方“Create”,新建接入服務模板“ACS”,Step1配置完成後單擊右下方“下一步”進入Step2,配置允許使用者進行認證的協議,配置完成後單擊右下方“Finish”。
在彈出的對話方塊中單擊“Yes”,進入“Access Policies > Access Services > Service Selection Rules”頁面,選擇“Rule based result selection”,單擊下方“Create”,在彈窗的對話方塊中建立接入服務規則“RADIUS”,匹配RADIUS協議之後進入“ACS”模板進行認證和授權,配置完成後單擊下方“OK”。單擊下方“∧”將該接入服務規則調整至第一條,認證時優先匹配該規則,單擊下方“Save Changes”儲存。
8.配置允許使用者進行認證的過濾條件
Access Policies > Access Services > ACS > Identity”,在右側操作區域上方選擇“Rule based result selection”,單擊右下方“Customize”配置允許使用者進行認證的過濾條件,此處選擇“Device IP Address”即可,配置完成後單擊“OK”儲存。
9.配置802.1X認證和MAC認證使用者的認證規則
例如:
“802.1x”和“MAC”,配置Conditions:“Device IP Address”為192.168.50.1,配置Results:“Identity Source”選擇Internal Users,配置完成後單擊“OK”,單擊“Save Changes”儲存配置。
10.新建群組授權策略
“Access Policies > Access Services > ACS > Authorization”,單擊右下方“Customize”配置授權條件,該舉例中選擇“Identity Group”即可,配置完成後單擊“OK”,再單擊“Save Changes”儲存。
單擊下方“Create”,新建群組pc_group1的授權策略“pc_group1_result”,選擇授權條件“Identity Group”為“pc_group1”,授權結果“Results”為“data_vlan”,單擊“OK”,再單擊“Save Changes”儲存配置。

11.配置管理員使用者認證和授權策略HWTACACS
Access Policies > Access Services”,單擊右側操作區域下方“Create”,建立認證和授權策略模板“HWTACACS”,Step1配置完成之後單擊右下方“下一步”進入Step2,配置允許使用者進行認證的協議,配置完成單擊右下方“Finish”。
ACS對接華為 配置筆記

在彈出的對話方塊中單擊“Yes”,進入“Access Policies > Access Services > Service Selection Rules”頁面,選擇“Rule based result selection”,單擊下方“Create”,在彈窗的對話方塊中建立接入服務規則“HWTACACS”,配置Conditions:“Protocol match Tacas”,配置Results:“Service:HWTACACS”,配置完成後單擊下方“OK”。單擊下方將該接入服務規則調整至第一條,認證時優先匹配該規則,單擊下方“Save Changes”儲存。

12.配置允許HWTACACS使用者進行認證的過濾條件
“Access Policies > Access Services > HWTACACS > Identity”,在右側操作區域上方選擇“Rule based result selection”,單擊右下方“Customize”,配置允許使用者進行認證的過濾條件,此處選擇“Device IP Address”即可,配置完成後單擊“OK”儲存。
單擊下方“Create”,建立管理員的認證規則“admin”,配置Conditions:“Device IP Address = 192.168.50.1”,配置Results:“Identity Source:Internal Users”,配置完成後單擊“OK”,單擊“Save Changes”儲存配置。
Access Policies > Access Services > HWTACACS > Authorization”,單擊右下方“Customize”,配置對使用者進行授權的過濾條件,“Customize Conditions” Selected “Identity Group”和“System:UserName”,“Customize Results” Selected “Shell Profiles”和“Command Sets”,配置完成單擊“OK”,再單擊“Save Changes”儲存。
單擊下方“Create”,建立管理員“diagnose”的授權策略“diagnose_policy”,配置“Conditions”:“Identity Group in All Groups:admin”、“System:UserName equals diagnose”,配置Results:“Shell Profile:PRIVILEGE_LEVEL_15”、“Command Sets:All”,單擊“OK”,再單擊“Save Changes”儲存配置。

    參考華為文件http://support.huawei.com/hedex/pages/EDOC1100037158AZH0823J/04/EDOC1100037158AZH0823J/04/resources/dc/dc_cfgcase_nac_1032u.html