Portal 認(rèn)證簡介
Portal認(rèn)證通常也稱為Web認(rèn)證,用戶接入網(wǎng)絡(luò)時,必須在門戶網(wǎng)站進(jìn)行認(rèn)證,如果未認(rèn)證成功,僅可以訪問特定的網(wǎng)絡(luò)資源,認(rèn)證成功后,才可以訪問其他網(wǎng)絡(luò)資源。
Portal認(rèn)證具有如下優(yōu)點:
一般情況下,客戶端不需要安裝額外的軟件,直接在Web頁面上認(rèn)證,簡單方便。
便于運營,可以在Portal頁面上進(jìn)行業(yè)務(wù)拓展,如廣告推送、責(zé)任公告、企業(yè)宣傳等。
技術(shù)成熟,被廣泛應(yīng)用于運營商、連鎖快餐、酒店、學(xué)校等網(wǎng)絡(luò)。
部署位置靈活,可以在接入層或關(guān)鍵數(shù)據(jù)的入口作訪問控制。
用戶管理靈活,可基于用戶名與VLAN/IP地址/MAC地址的組合對用戶進(jìn)行認(rèn)證。公司訪客流動性大,因此一般選擇Portal認(rèn)證。
網(wǎng)絡(luò)需求
某企業(yè)由于業(yè)務(wù)需要,需要部署一套身份認(rèn)證系統(tǒng),對公司訪客接入網(wǎng)絡(luò)進(jìn)行準(zhǔn)入控制,確保只有合法用戶才能接入網(wǎng)絡(luò)。
主要有如下需求:
- 希望操作簡單,只做準(zhǔn)入授權(quán),盡量減少在終端上安裝其他的軟件。
- 對嘗試接入園區(qū)網(wǎng)的所有終端進(jìn)行統(tǒng)一的身份認(rèn)證,拒絕身份不合法的終端接入園區(qū)網(wǎng)。
本例中匯聚交換機以華為S7700為例,接入交換機以華為S5720HI為例。

實驗配置邏輯
- 華為交換機配置邏輯

- 思科ISE配置邏輯
| 配置項 | 說明 |
|---|---|
| 添加群組及訪客賬號 | - |
| 添加交換機 | 指定允許與ISE對接的交換機。 |
| (可選)創(chuàng)建認(rèn)證協(xié)議模板 | 指定訪客進(jìn)行Portal認(rèn)證可以使用的認(rèn)證協(xié)議。如果未創(chuàng)建新的認(rèn)證協(xié)議模板,則使用ISE默認(rèn)的“DefaultNetwork Access”模板。 |
| 創(chuàng)建認(rèn)證策略 | 指定訪客通過Portal認(rèn)證需要滿足的條件。 |
| (可選)創(chuàng)建授權(quán)策略 | 指定訪客通過Portal認(rèn)證后允許訪問的資源。如果未創(chuàng)建授權(quán)策略,則允許訪客訪問所有其路由可達(dá)的資源。 |
IP地址及接口規(guī)劃
- 交換機數(shù)據(jù)規(guī)劃
| 項目 | 接口 | 所屬VLAN | IP地址 |
|---|---|---|---|
| SWITCH A | GE0/0/1,GE0/0/2 | 10 | VLANIF10:192.168.10.2/24 |
| SWITCH B | GE0/0/1,GE0/0/2 | 20 | VLANIF20: 192.168.20.2/24 |
| SWITCH C | GE1/0/1 | 10 | VLANIF10:192.168.10.1/24 |
| SWITCH C | GE1/0/2 | 20 | VLANIF20:192.168.20/1/24 |
| SWITCH C | GE1/0/3 | 30 | VLANIF100:192.168.100.254/24 |
- 認(rèn)證數(shù)據(jù)規(guī)劃
| 項目 | 數(shù)據(jù) |
|---|---|
| ISE | IP地址:192.168.100.1/24 |
| RADIUS共享密鑰和Portal共享密鑰 | Huawei@2014 |
| 接入認(rèn)證設(shè)備 | SwitchA:192.168.10.2/24 |
| 接入認(rèn)證設(shè)備 | SwitchB:192.168.20.2/24 |
| 訪客 | 研發(fā)部:賬號(A-123/Huawei@123,市場部:賬號(B-123/Huawei@B-123) |
實驗配置
- 配置匯聚交換機,保證網(wǎng)絡(luò)互通。
<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[SwitchC] vlan batch 10 20 100
[SwitchC] interface gigabitethernet 1/0/1
[SwitchC-GigabitEthernet1/0/1] port link-type trunk
[SwitchC-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[SwitchC-GigabitEthernet1/0/1] quit
[SwitchC] interface gigabitethernet 1/0/2
[SwitchC-GigabitEthernet1/0/2] port link-type trunk
[SwitchC-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
[SwitchC-GigabitEthernet1/0/2] quit
[SwitchC] interface gigabitethernet 1/0/3
[SwitchC-GigabitEthernet1/0/2] port link-type access
[SwitchC-GigabitEthernet1/0/2] port default vlan 100
[SwitchC-GigabitEthernet1/0/2] quit
[SwitchC] interface Vlanif 10
[SwitchC-Vlanif10] ip address 192.168.10.1 24
[SwitchC-Vlanif10] quit
[SwitchC] interface Vlanif 20
[SwitchC-Vlanif20] ip address 192.168.20.1 24
[SwitchC-Vlanif20] quit
[SwitchC] interface Vlanif 100
[SwitchC-Vlanif100] ip address 192.168.100.254 24
[SwitchC-Vlanif100] quit
- 配置接入交換機。以配置連接研發(fā)部的接入交換機Switch A為例,連接市場部的接入交換機Switch B配置類似,這里不再贅述。
- 創(chuàng)建VLAN并配置接口允許通過的VLAN,保證網(wǎng)絡(luò)互通
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type access
[SwitchA-GigabitEthernet0/0/1] port default vlan 10
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/2] quit
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 192.168.10.2 24
[SwitchA-Vlanif10] quit
[SwitchA] ip route-static 192.168.100.0 24 192.168.10.1
- 配置與RADIUS服務(wù)器的對接參數(shù)。
創(chuàng)建RADIUS服務(wù)器模板“policy”
[SwitchA] radius-server template policy
[SwitchA-radius-policy] radius-server authentication 192.168.100.1 1812 source ip-address 192.168.10.2 //配置RADIUS認(rèn)證服務(wù)器
[SwitchA-radius-policy] radius-server accounting 192.168.100.1 1813 source ip-address 192.168.10.2
[SwitchA-radius-policy] radius-server shared-key cipher Huawei@2014 //配置RADIUS共享密鑰Huawei@2014
[SwitchA-radius-policy] calling-station-id mac-format hyphen-split mode2 //配置RADIUS報文中calling-station-id屬性字段中MAC地址的封裝格式為xx-xx-xx-xx-xx-xx
[SwitchA-radius-policy] quit
創(chuàng)建AAA認(rèn)證方案“auth”
[SwitchA] aaa
[SwitchA-aaa] authentication-scheme auth
[SwitchA-aaa-authen-auth] authentication-mode radius //配置認(rèn)證方式為RADIUS
[SwitchA-aaa-authen-auth] quit
配置AAA計費方案“acco”。為了方便RADIUS服務(wù)器維護(hù)帳號的狀態(tài)信息,例如上下線信息,強制帳號下線,計費模式必須配置為radius。
[SwitchA-aaa] accounting-scheme acco
[SwitchA-aaa-accounting-acco] accounting-mode radius //配置計費方式為RADIUS
[SwitchA-aaa-accounting-acco] accounting realtime 15 //配置實時計費周期為15分鐘
[SwitchA-aaa-accounting-acco] quit
創(chuàng)建認(rèn)證域“portal”
[SwitchA-aaa] domain portal
[SwitchA-aaa-domain-portal] authentication-scheme auth //認(rèn)證域下綁定認(rèn)證方案auth
[SwitchA-aaa-domain-portal] accounting-scheme acco //認(rèn)證域下綁定計費方案acco
[SwitchA-aaa-domain-portal] radius-server policy //認(rèn)證域下綁定RADIUS服務(wù)器模板policy
[SwitchA-aaa-domain-portal] quit
[SwitchA-aaa] quit
配置認(rèn)證域“portal”為全局默認(rèn)認(rèn)證域。
[SwitchA] domain portal
- 配置Portal認(rèn)證。
- 將NAC配置模式切換成統(tǒng)一模式。
[SwitchA] authentication unified-mode
- 配置SSL策略。
[SwitchA] ssl policy portal
[SwitchA-ssl-policy-portal] certificate load pem-cert cert_rsa_cert.pem key-pair rsa keyfilecert_rsa_key.pem auth-code cipher huawei //該密鑰必須與制作證書時設(shè)置的密鑰一致
[SwitchA-ssl-policy-portal] ssl minimum version tls1.0
[SwitchA-ssl-policy-portal] quit
- 開啟HTTPS協(xié)議的Portal對接功能。
[SwitchA] portal web-authen-server https ssl-policy portal
- 配置URL模板“u1”。
[SwitchA] url-template name u1
[SwitchA-url-template-u1] url https://192.168.100.1:8443/portal/
PortalSetup.action#portal=0ce17ad0-6d90-11e5-978e-005056bf2f0a //獲取該URL,請參見獲取
- Portal認(rèn)證界面的URL
[SwitchA-url-template-u1] parameter start-mark # //將URL中參數(shù)的開始符號“#”替換成“?”
[SwitchA-url-template-u1] url-parameter login-url switch_url https://192.168.10.2:8443
[SwitchA-url-template-u1] quit
- 配置Portal服務(wù)器模板“w1”。
[SwitchA] web-auth-server w1
[SwitchA-web-auth-server-w1] server-ip 192.168.100.1 //指定Portal認(rèn)證界面所在的ISE的地址
[SwitchA-web-auth-server-w1] shared-key cipher Huawei@2014
[SwitchA-web-auth-server-w1] url-template u1 //綁定URL模板u1
[SwitchA-web-auth-server-w1] quit
- 配置Portal接入模板“p1”。
[SwitchA] portal-access-profile name p1
[SwitchA-portal-acces-profile-p1] web-auth-server w1 direct //綁定Portal服務(wù)器模板w1
[SwitchA-portal-acces-profile-p1] quit
- 配置免認(rèn)證規(guī)則模板“default_free_rule”。
[SwitchA] free-rule-template name default_free_rule
[SwitchA-free-rule-default_free_rule] free-rule 1 destination ip 192.168.10.2 mask 255.255.255.255
[SwitchA-free-rule-default_free_rule] quit
- 配置認(rèn)證模板“a1”。
[SwitchA] authentication-profile name a1
[SwitchA-authen-profile-a1] portal-access-profile p1 //綁定Portal接入模板p1
[SwitchA-authen-profile-a1] quit
- 在接口上使能Portal認(rèn)證。
[SwitchA] interface GigabitEthernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] authentication-profile a1
[SwitchA-GigabitEthernet0/0/1] quit
- 思科ISE配置
- 登錄ISE。
a. 打開Internet Explorer瀏覽器,在地址欄輸入ISE的訪問地址,單擊“Enter”。
b. 輸入ISE管理員賬號和密碼登錄ISE。
- 創(chuàng)建組和賬號
a. 選擇“Administration > Identity Management > Groups”,在左側(cè)導(dǎo)航區(qū)域選擇“User Identity Groups”,在右側(cè)操作區(qū)域內(nèi)單擊“Add”,創(chuàng)建群組“R&D”,設(shè)置完成單擊左下角“Submit”提交。

b. 選擇“Administration > Identity Management > Identities”,在左側(cè)導(dǎo)航區(qū)域選擇“Users”,在右側(cè)操作區(qū)域單擊“Add”,創(chuàng)建用戶A,用戶名為“A-123”,密碼為“Huawei@123”,綁定到群組“R&D”,設(shè)置完成之后單擊下方“Submit”提交。用戶B與之類似,此處不再贅述。

- 在ISE中添加交換機設(shè)備,以便ISE能與交換機正常通信。
a. 在上方導(dǎo)航區(qū)域選擇“Administration > Network Resources > Network Device Profiles”,單擊下方“Add”,創(chuàng)建接入認(rèn)證設(shè)備模板“HUAWEI”,“Vendor”選擇“Other”,勾選“RADIUS”,“RADIUS Dictionaries”選擇“HW”,按照圖示配置“Change of Authorization (CoA)”,完成后單擊下方“Submit”提交。


b. 選擇“Administration > Network Resources > Network Devices”,在右側(cè)操作區(qū)域單擊“Add”,添加接入認(rèn)證設(shè)備SwitchA,在“New Network Device”頁面根據(jù)下表設(shè)置SwitchA參數(shù),設(shè)置完成之后單擊下方“Submit”提交。
| 參數(shù) | 取值 | 說明 |
|---|---|---|
| 接入設(shè)備名稱 | Switch A | - |
| IP地址 | 192.168.10.2/24 | - |
| RADIUS共享密鑰 | Huawei@2014 | 必須與交換機上配置的RADIUS共享密鑰相同。 |

- 在ISE中增加認(rèn)證策略,對接入用戶進(jìn)行身份認(rèn)證。
a. 在上方導(dǎo)航區(qū)域選擇“Policy > Policy Elements > Conditions”,在左側(cè)導(dǎo)航區(qū)域擇“Authentication > Compound Conditions”,在右側(cè)操作區(qū)域單擊“Add”。
b. 創(chuàng)建認(rèn)證條件模板“Portal”,設(shè)置認(rèn)證條件,“RADIUS:Service-Type”選擇“Outbound”,“RADIUS:NAS-IP-Address”選擇“192.168.10.2”,設(shè)置完成之后單擊下方“Submit”提交。

c. 在上方導(dǎo)航區(qū)域選擇“Policy > Policy Elements > Results”,在左側(cè)導(dǎo)航區(qū)域選擇“Authentication > Allowed Protocols”,在右側(cè)操作區(qū)域單擊“Add”。
d. 創(chuàng)建允許用戶進(jìn)行認(rèn)證的協(xié)議模板“Portal”,勾選“Allow PAP/ASCII”和“Allow CHAP”,設(shè)置完成之后單擊下方“Submit”提交。

e. 在上方導(dǎo)航區(qū)域選擇“Policy > Authentication”,選擇“Rule-Based”。單擊第一條認(rèn)證策略最右側(cè)的三角形,選擇“Insert new row above”。創(chuàng)建認(rèn)證策略“Portal”,添加認(rèn)證條件模板“Portal”及允許用戶進(jìn)行認(rèn)證的協(xié)議模板“Portal”,單擊右側(cè)“Done”完成配置,單擊下方“Save”保存。

- 獲取Portal認(rèn)證界面的URL。
a. 選擇“Guest Access > Configure > Guest Portals”,單擊下方操作區(qū)域“Self-Registered Guest Portal (default)”。

b.單擊“Portal test URL”,彈出的頁面即為用戶進(jìn)行Portal認(rèn)證的界面,該頁面URL即為交換機URL模板上配置的URL。

- 檢查配置結(jié)果。
a.員工在沒有認(rèn)證的情況下只能訪問ISE服務(wù)器。
b.認(rèn)證通過后,在交換機上執(zhí)行命令display access-user,可以看到員工的在線信息。