40-端口安全配置舉例
本章節下載: 40-端口安全配置舉例 (543.17 KB)
H3C S6800&S6860&S6861 產品端口安全配置舉例
Copyright © 2019 bobty下载软件 版權所有,保留一切權利。
非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。
除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。
本文檔中的信息可能變動,恕不另行通知。
目 錄
5.4.1 配置RADIUS Server(iMC PLAT 7.0)
6 端口安全macAddressElseUserLoginSecure模式配置舉例
6.4.1 配置RADIUS Server(iMC PLAT 7.0)
7 端口安全支持ClearPass服務器下發重定向URL配置舉例
本文檔介紹端口安全的配置舉例。
端口安全通過對已有的802.1X認證和MAC地址認證進行融合和擴充,在端口上為使用不同認證方式的用戶提供基於MAC地址的網絡接入控製。
端口安全的主要功能為:
· 通過檢測端口收到的數據幀中的源MAC地址來控製非授權設備或主機對網絡的訪問。
· 通過檢測從端口發出的數據幀中的目的MAC地址來控製對非授權設備的訪問。
· 通過定義各種端口安全模式,控製端口上的MAC地址學習或定義端口上的組合認證方式,讓設備學習到合法的源MAC地址,以達到相應的網絡管理效果。
其中端口安全模式分為兩大類:控製MAC學習類和認證類。
· 控製MAC學習類:無需認證,包括端口自動學習MAC地址和禁止MAC地址學習兩種模式(例如舉例中的autoLearn模式)。
· 認證類:利用MAC地址認證和802.1X認證機製來實現,包括單獨認證和組合認證等多種模式(例如舉例中的userLoginWithOUI模式、macAddressElseUserLoginSecure模式)。
本文檔中的配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下舉例中的配置不衝突。
本文假設您已了解端口安全特性。
· 如果已全局開啟了802.1X或MAC地址認證功能,則無法使能端口安全功能。
· 當端口安全功能開啟後,端口上的802.1X功能以及MAC地址認證功能將不能被手動開啟,且802.1X端口接入控製方式和端口接入控製模式也不能被修改,隻能隨端口安全模式的改變由係統更改。
· 端口上有用戶在線的情況下,關閉端口安全功能會導致端口上所有在線用戶下線。
· 端口安全模式的配置與端口加入聚合組或業務環回組互斥。
· 當多個用戶通過認證時,端口下所允許的最大用戶數根據不同的端口安全模式,取端口安全所允許的最大MAC地址數與相應模式下允許認證用戶數的最小值。例如,userLoginSecureExt模式下,端口下所允許的最大用戶為配置的端口安全所允許的最大MAC地址數與802.1X認證所允許的最大用戶數的最小值。
· 當端口安全已經使能且當前端口安全模式不是noRestrictions時,若要改變端口安全模式,必須首先執行undo port-security port-mode命令恢複端口安全模式為noRestrictions模式。
如圖1所示,用戶通過Device連接到網絡。通過配置端口安全autolearn模式,實現對接入用戶的控製,具體需求如下:
· 最多同時允許64個用戶直接通過交換機接入Internet,無需進行認證;
· 當用戶數量超過設定值後,新用戶無法通過Device接入Internet。
圖1 端口安全autoLearn模式組網圖
· 配置交換機與用戶相連端口的安全模式為autolearn,允許用戶自由接入。
· 為防止交換機與用戶相連端口學習到的MAC地址的丟失,及安全MAC地址不老化會帶來一些問題,需配置安全MAC地址並設定安全MAC地址老化時間(例如30分鍾)。
· 配置最大安全MAC地址數為64,當安全MAC地址數量達到64後,停止學習;配置入侵檢測特性方式為disableport-temporarily,當再有新的MAC地址接入時,交換機與用戶相連端口被暫時斷開連接,30秒後自動恢複端口的開啟狀態。
產品 |
軟件版本 |
S6800係列 S6860係列 S6861係列 |
Release 2702 |
當端口工作於autoLearn模式時,無法更改端口安全允許的最大MAC地址數。
# 使能端口安全。
<Device> system-view
[Device] port-security enable
# 設置安全MAC地址的老化時間為30分鍾。
[Device] port-security timer autolearn aging 30
# 設置端口安全允許的最大安全MAC地址數為64。
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] port-security max-mac-count 64
# 設置端口安全模式為autoLearn。
[Device-Ten-GigabitEthernet1/0/1] port-security port-mode autolearn
# 設置觸發入侵檢測特性後的保護動作為暫時關閉端口,關閉時間為30秒。
[Device-Ten-GigabitEthernet1/0/1] port-security intrusion-mode disableport-temporarily
[Device-Ten-GigabitEthernet1/0/1] quit
[Device] port-security timer disableport 30
# 上述配置完成後,可以使用display port-security interface命令查看端口安全的配置情況。
[Device] display port-security interface ten-gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
AutoLearn aging time : 30 min
Disableport timeout : 30 s
Blockmac timeout : 180 s
MAC move : Denied
Authorization fail : Online
NAS-ID profile : Not configured
Dot1x-failure trap : Disabled
Dot1x-logon trap : Disabled
Dot1x-logoff trap : Disabled
Intrusion trap : Disabled
Address-learned trap : Disabled
Mac-auth-failure trap : Disabled
Mac-auth-logon trap : Disabled
Mac-auth-logoff trap : Disabled
Open authentication : Disabled
OUI value list :
Ten-GigabitEthernet1/0/1 is link-up
Port mode : autoLearn
NeedToKnow mode : Disabled
Intrusion protection mode : DisablePortTemporarily
Security MAC address attribute
Learning mode : Sticky
Aging type : Periodical
Max secure MAC addresses : 64
Current secure MAC addresses : 5
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
可以看到端口安全所允許的最大安全MAC地址數為64,端口模式為autoLearn,入侵檢測保護動作為DisablePortTemporarily,入侵發生後端口被禁用時間為30秒。
配置生效後,端口允許地址學習,學習到的MAC地址數可在上述顯示信息的“Current secure MAC addresses”字段查看到。
# 具體的MAC地址信息可以在二層以太網接口視圖下用display this命令查看。
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] display this
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port-security intrusion-mode disableport-temporarily
port-security max-mac-count 64
port-security port-mode autolearn
port-security mac-address security sticky 00e0-fc00-5920 vlan 1
port-security mac-address security sticky 00e0-fc00-592a vlan 1
port-security mac-address security sticky 00e0-fc00-592b vlan 1
port-security mac-address security sticky 00e0-fc00-592c vlan 1
port-security mac-address security sticky 00e0-fc00-592d vlan 1
#
# 當學習到的MAC地址數達到64後,用命令display port-security interface可以看到端口模式變為secure,再有新的MAC地址到達將觸發入侵保護,可以通過命令display interface看到此端口關閉。30秒後,端口狀態恢複。此時,如果手動刪除幾條安全MAC地址後,端口安全的狀態重新恢複為autoLearn,可以繼續學習MAC地址。
#
port-security enable
port-security timer disableport 30
port-security timer autolearn aging 30
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port-security intrusion-mode disableport-temporarily
port-security max-mac-count 64
port-security port-mode autolearn
#
如圖2所示,用戶Host(已安裝802.1X客戶端軟件)和打印機Printer通過交換機Device連接到網絡,交換機通過RADIUS服務器對用戶進行身份認證,如果認證成功,用戶被授權允許訪問Internet資源。IP地址為192.168.0.38的RADIUS服務器作為認證服務器和計費服務器,認證/計費共享密鑰為expert。
通過配置端口安全userLoginWithOUI模式,實現對接入用戶的控製,具體需求如下:
· 所有接入用戶都使用ISP域sun的認證/授權/計費方法;
· 最多允許一個802.1X用戶通過端口Ten-GigabitEthernet1/0/1接入Internet;
· 允許打印機通過與交換機相連端口實現與Internet資源正常連接;
· 當有非法用戶接入時,觸發入侵檢測,將非法報文丟棄(不對端口進行關閉)。
· 配置交換機與用戶端相連的端口安全模式為userLoginWithOUI,即:該端口最多隻允許一個802.1X認證用戶接入,還允許一個指定OUI的源MAC地址的報文認證通過。為userLoginWithOUI端口安全模式配置5個OUI值(對應不同廠商的打印機MAC地址的OUI)。
· 配置端口安全的入侵檢測功能:當交換機與用戶端相連的端口接收到非法報文後,觸發入侵檢測,將非法報文丟棄,同時將其源MAC地址加入阻塞MAC地址列表中。
表2 適用產品及版本
產品 |
軟件版本 |
S6800係列 S6860係列 S6861係列 |
Release 2702 |
下麵以iMC為例(使用iMC版本為:iMC PLAT 7.0 (E0201)、iMC EIA 7.0 (E0201)),說明RADIUS server的基本配置。
#增加接入設備
登錄進入iMC管理平台,選擇“用戶”頁簽,單擊導航樹中的[接入策略管理/接入設備管理/接入設備配置]菜單項,進入接入設備配置頁麵,在該頁麵中單擊“增加”按鈕,進入增加接入設備頁麵。
· 設置與Device交互報文時的認證、計費共享密鑰為“expert”;
· 設置認證及計費的端口號分別為“1812”和“1813”;
· 選擇業務類型為“LAN接入業務”;
· 選擇接入設備類型為“H3C(General)”;
· 選擇或手工增加接入設備,添加IP地址為192.168.0.34的接入設備;
· 其它參數采用缺省值,並單擊<確定>按鈕完成操作。
添加的接入設備IP地址要與Device發送RADIUS報文的源地址保持一致。缺省情況下,設備發送RADIUS報文的源地址是發送RADIUS報文的接口IP地址。
· 若設備上通過命令nas-ip或者radius nas-ip指定了發送RADIUS報文的源地址,則此處的接入設備IP地址就需要修改並與指定源地址保持一致。
· 若設備使用缺省的發送RADIUS報文的源地址,例如,本例中為設備連接服務器端的接口的IP地址192.168.0.34,則此處接入設備IP地址就選擇192.168.0.34。
圖3 增加接入設備
# 增加接入策略
選擇“用戶”頁簽,單擊導航樹中的[接入策略管理/接入策略管理]菜單項,在該頁麵中單擊<增加>按鈕,進入增加接入策略配置頁麵。
· 接入策略名為“802.1X-auth”;
· 其他配置采用頁麵默認配置即可;
· 單擊<確定>按鈕完成操作。
# 增加服務配置。
選擇“用戶”頁簽,單擊導航樹中的[接入策略管理/接入服務管理]菜單項,在該頁麵中單擊<增加>按鈕,進入增加服務配置頁麵。
· 輸入服務名為“802.1X-auth/acct”;
· 缺省接入策略為“802.1X-auth”;
· 選擇計費策略為“不計費”;
· 本配置頁麵中還有其它服務配置選項,請根據實際情況選擇配置;
· 單擊<確定>按鈕完成操作。
圖4 增加服務配置
# 增加接入用戶。
選擇“用戶”頁簽,單擊導航樹中的[接入用戶管理/接入用戶]菜單項,進入接入用戶列表頁麵,在該頁麵中單擊<增加>按鈕,進入增加接入用戶頁麵。
· 選擇或者手工增加用戶姓名為“hello”;
· 輸入帳號名“802.1X”和密碼802.1X;
· 選擇該用戶所關聯的接入服務為“802.1X-auth/acct”;
· 本配置頁麵中還有其它服務配置選項,請根據實際情況選擇配置;
· 單擊<確定>按鈕完成操作。
圖5 增加接入用戶
· 下述配置步驟包含了部分AAA/RADIUS協議配置命令,具體介紹請參見“安全配置指導”中的“AAA”。
· 保證客戶端和RADIUS服務器之間路由可達。
· 配置AAA
# 創建RADIUS方案。並配置RADIUS方案主認證/計費服務器及其通信密鑰。
<Device> system-view
[Device] radius scheme radsun
New RADIUS scheme.
[Device-radius-radsun] primary authentication 192.168.0.38
[Device-radius-radsun] primary accounting 192.168.0.38
[Device-radius-radsun] key authentication simple expert
[Device-radius-radsun] key accounting simple expert
#配置係統向RADIUS服務器重發報文的時間間隔為5秒,重發次數為5次,發送實時計費報文的時間間隔為15分鍾,發送的用戶名不帶域名。
[Device-radius-radsun] timer response-timeout 5
[Device-radius-radsun] retry 5
[Device-radius-radsun] timer realtime-accounting 15
[Device-radius-radsun] user-name-format without-domain
[Device-radius-radsun] quit
# 配置ISP域,並設置為係統缺省的ISP域。
[Device] domain sun
[Device-isp-sun] authentication lan-access radius-scheme radsun
[Device-isp-sun] authorization lan-access radius-scheme radsun
[Device-isp-sun] accounting lan-access radius-scheme radsun
[Device-isp-sun] quit
[Device] domain default enable sun
· 配置802.1X
# 配置802.1X的認證方式為CHAP。(該配置可選,缺省情況下802.1X的認證方式為CHAP)
[Device] dot1x authentication-method chap
· 配置端口安全
# 添加5個OUI值。(最多可添加16個,此處僅為示例。最終,端口僅允許一個與某OUI值匹配的用戶通過認證)
[Device] port-security oui index 1 mac-address 1234-0100-1111
[Device] port-security oui index 2 mac-address 1234-0200-1111
[Device] port-security oui index 3 mac-address 1234-0300-1111
[Device] port-security oui index 4 mac-address 1234-0400-1111
[Device] port-security oui index 5 mac-address 1234-0500-1111
# 設置端口安全模式為userLoginWithOUI。
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] port-security port-mode userlogin-withoui
# 設置觸發入侵檢測功能後,將非法報文丟棄,同時將其源MAC地址加入阻塞MAC地址列表中。
[Device-Ten-GigabitEthernet1/0/1] port-security intrusion-mode blockmac
[Device-Ten-GigabitEthernet1/0/1] quit
# 使能端口安全。
[Device] port-security enable
# 查看名稱為radsun的RADIUS方案的配置信息。
[Device] display radius scheme radsun
Total 1 RADIUS schemes
------------------------------------------------------------------
RADIUS scheme name: radsun
Index: 0
Primary authentication server:
Host name: Not configured
IP : 192.168.0.38 Port: 1812
VPN : Not configured
State: Active
Test profile: Not configured
Weight: 0
Primary accounting server:
Host name: Not configured
IP : 192.168.0.38 Port: 1813
VPN : Not configured
State: Active
Weight: 0
Accounting-On function : Disabled
extended function : Disabled
retransmission times : 50
retransmission interval(seconds) : 3
Timeout Interval(seconds) : 5
Retransmission Times : 5
Retransmission Times for Accounting Update : 5
Server Quiet Period(minutes) : 5
Realtime Accounting Interval(seconds) : 900
Stop-accounting packets buffering : Enabled
Retransmission times : 500
NAS IP Address : Not configured
VPN : Not configured
User Name Format : without-domain
Data flow unit : Byte
Packet unit : One
Attribute 15 check-mode : Strict
Attribute 25 : Standard
Attribute Remanent-Volume unit : Kilo
server-load-sharing : Disabled
Attribute 31 MAC format : HH-HH-HH-HH-HH-HH
Stop-accounting-packet send-force : Disabled
Reauthentication server selection : Reselect
------------------------------------------------------------------
# 查看端口安全的配置信息。
[Device] display port-security interface ten-gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
AutoLearn aging time : 0 min
Disableport timeout : 20 s
Blockmac timeout : 180 s
MAC move : Denied
Authorization fail : Online
NAS-ID profile : Not configured
Dot1x-failure trap : Disabled
Dot1x-logon trap : Disabled
Dot1x-logoff trap : Disabled
Intrusion trap : Disabled
Address-learned trap : Disabled
Mac-auth-failure trap : Disabled
Mac-auth-logon trap : Disabled
Mac-auth-logoff trap : Disabled
Open authentication : Disabled
OUI value list :
Index : 1 Value : 123401
Index : 2 Value : 123402
Index : 3 Value : 123403
Index : 4 Value : 123404
Index : 5 Value : 123405
Ten-GigabitEthernet1/0/1 is link-up
Port mode : userLoginWithOUI
NeedToKnow mode : Disabled
Intrusion protection mode : NoAction
Security MAC address attribute
Learning mode : Sticky
Aging type : Periodical
Max secure MAC addresses : Not configured
Current secure MAC addresses : 0
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
配置完成後,如果有802.1X用戶上線,則可以通過上述顯示信息看到當前端口保存的MAC地址數為1。還可以通過display dot1x命令查看該802.1X用戶的在線情況。
# 可以通過display mac-address interface命令查看端口允許MAC地址與OUI值匹配的用戶通過的信息。
[Device] display mac-address interface ten-gigabitethernet 1/0/1
MAC Address VLAN ID State Port/NickName Aging
1234-0300-0011 1 Learned XGE1/0/1 Y
#
port-security enable
port-security oui index 1 mac-address 1234-0100-0000
port-security oui index 2 mac-address 1234-0200-0000
port-security oui index 3 mac-address 1234-0300-0000
port-security oui index 4 mac-address 1234-0400-0000
port-security oui index 5 mac-address 1234-0500-0000
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port-security port-mode userlogin-withoui
port-security intrusion-mode blockmac
#
radius scheme radsun
primary authentication 192.168.0.38
primary accounting 192.168.0.38
key authentication cipher $c$3$s9TAYm34R8sS5k/Cylg2sDm69ZRupMvGJg==
key accounting cipher $c$3$UaUPGk8AfZAQLHFlbKNcEoM2HXGiuWowBQ==
retry 5
timer response-timeout 5
timer realtime-accounting 15
user-name-format without-domain
#
domain sun
authentication lan-access radius-scheme radsun
authorization lan-access radius-scheme radsun
accounting lan-access radius-scheme radsun
#
domain default enable sun
#
如圖6所示,客戶端通過端口Ten-GigabitEthernet1/0/1連接到Device上,Device通過RADIUS服務器對客戶端進行身份認證。如果認證成功,客戶端被授權允許訪問Internet資源。通過配置端口安全macAddressElseUserLoginSecure模式,實現對接入用戶的控製,具體需求如下:
· 可以有多個MAC認證用戶接入;
· 802.1X用戶請求認證時,先進行MAC地址認證,MAC地址認證失敗,再進行802.1X認證。最多隻允許一個802.1X用戶接入;
· 上線的MAC地址認證用戶和802.1X認證用戶總和不能超過64個;
· MAC地址認證設置用戶名格式為固定用戶名格式,用戶名為aaa,密碼為123456;
· 為防止報文發往未知目的MAC地址,啟動ntkonly方式的Need To Know特性。
圖6 端口安全macAddressElseUserLoginSecure模式組網圖
· 配置交換機與用戶端相連的端口安全模式為macAddressElseUserLoginSecure,即:對於非802.1X報文進行MAC地址認證,對於802.1X報文先進行MAC地址認證,如果MAC地址認證失敗再進行802.1X認證。
· 為實現通過端口安全的入侵檢測功能限製認證端口出方向的報文轉發。可配置NeedToKnow功能為ntkonly模式,即僅允許目的MAC地址為已通過認證的MAC地址的單播報文通過。
表3 適用產品及版本
產品 |
軟件版本 |
S6800係列 S6860係列 S6861係列 |
Release 2702 |
下麵以iMC為例(使用iMC版本為:iMC PLAT 7.0 (E0201) 、iMC EIA 7.0 (E0201)),說明RADIUS server的基本配置。
(1) 需要在RADIUS Server上增加“接入設備”,並創建802.1X認證相關的“接入策略”,“服務配置”及“用戶”的信息。參見5.4.1 配置RADIUS Server(iMC PLAT 7.0)。
(2) 需要在RADIUS Server上創建MAC地址認證相關的“接入策略”,“服務配置”及“用戶”的信息。如下:
#增加接入策略
選擇“用戶”頁簽,單擊導航樹中的[接入策略管理/接入策略管理]菜單項,在該頁麵中單擊<增加>按鈕,進入增加接入策略配置頁麵。
· 接入策略名為“MAC-auth”
· 其他配置采用頁麵默認配置即可;
· 單擊<確定>按鈕完成操作。
# 增加服務配置。
選擇“用戶”頁簽,單擊導航樹中的[接入策略管理/接入服務管理]菜單項,在該頁麵中單擊<增加>按鈕,進入增加服務配置頁麵。
· 輸入服務名為“MAC-auth/acct”;
· 缺省接入策略為“MAC-auth”;
· 選擇計費策略為“不計費”;
· 本配置頁麵中還有其它服務配置選項,請根據實際情況選擇配置;
· 單擊<確定>按鈕完成操作。
圖7 增加服務配置
# 增加接入用戶。
選擇“用戶”頁簽,單擊導航樹中的[接入用戶管理/接入用戶]菜單項,進入接入用戶列表頁麵,在該頁麵中單擊<增加>按鈕,進入增加接入用戶頁麵。
· 選擇或者手工增加用戶姓名為“hello2”;
· 輸入帳號名“aaa”和密碼123456;
· 選擇該用戶所關聯的接入服務為“MAC-auth/acct”;
· 本配置頁麵中還有其它服務配置選項,請根據實際情況選擇配置;
· 單擊<確定>按鈕完成操作。
圖8 增加接入用戶
保證接入用戶和RADIUS服務器之間路由可達。
· 配置AAA
# 創建RADIUS方案。並配置RADIUS方案主認證/計費服務器及其通信密鑰。
<Device> system-view
[Device] radius scheme radsun
New RADIUS scheme.
[Device-radius-radsun] primary authentication 192.168.0.38
[Device-radius-radsun] primary accounting 192.168.0.38
[Device-radius-radsun] key authentication simple expert
[Device-radius-radsun] key accounting simple expert
# 配置係統向RADIUS服務器重發報文的時間間隔為5秒,重發次數為5次,發送實時計費報文的時間間隔為15分鍾,發送的用戶名不帶域名。
[Device-radius-radsun] timer response-timeout 5
[Device-radius-radsun] retry 5
[Device-radius-radsun] timer realtime-accounting 15
[Device-radius-radsun] user-name-format without-domain
[Device-radius-radsun] quit
# 配置ISP域,並設置為係統缺省的ISP域。
[Device] domain sun
[Device-isp-sun] authentication lan-access radius-scheme radsun
[Device-isp-sun] authorization lan-access radius-scheme radsun
[Device-isp-sun] accounting lan-access radius-scheme radsun
[Device-isp-sun] quit
[Device] domain default enable sun
· 配置MAC地址認證
# 配置MAC地址認證的用戶名為aaa,密碼為123456。
[Device] mac-authentication user-name-format fixed account aaa password simple 123456
# 配置MAC地址認證用戶所使用的ISP域。
[Device] mac-authentication domain sun
· 配置802.1X認證
# 配置802.1X的認證方式為CHAP。(該配置可選,缺省情況下802.1X的認證方式為CHAP)
[Device] dot1x authentication-method chap
· 配置端口安全
# 設置端口安全允許的最大MAC地址數為64。
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] port-security max-mac-count 64
# 設置端口安全模式為macAddressElseUserLoginSecure。
[Device-Ten-GigabitEthernet1/0/1] port-security port-mode mac-else-userlogin-secure
# 設置端口Need To Know模式為ntkonly。
[Device-Ten-GigabitEthernet1/0/1] port-security ntk-mode ntkonly
[Device-Ten-GigabitEthernet1/0/1] quit
# 使能端口安全。
[Device] port-security enable
# 查看端口安全的配置信息。
[Device] display port-security interface ten-gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
AutoLearn aging time : 30 min
Disableport timeout : 30 s
Blockmac timeout : 180 s
MAC move : Denied
Authorization fail : Online
NAS-ID profile : Not configured
Dot1x-failure trap : Disabled
Dot1x-logon trap : Disabled
Dot1x-logoff trap : Disabled
Intrusion trap : Disabled
Address-learned trap : Disabled
Mac-auth-failure trap : Disabled
Mac-auth-logon trap : Disabled
Mac-auth-logoff trap : Disabled
Open authentication : Disabled
OUI value list :
Ten-GigabitEthernet1/0/1 is link-up
Port mode : macAddressElseUserLoginSecure
NeedToKnow mode : NeedToKnowOnly
Intrusion protection mode : DisablePortTemporarily
Security MAC address attribute
Learning mode : Sticky
Aging type : Periodical
Max secure MAC addresses : 64
Current secure MAC addresses : 0
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
# 查看MAC地址認證信息。
[Device] display mac-authentication interface ten-gigabitethernet 1/0/1
Global MAC authentication parameters:
MAC authentication : Enabled
Authentication method : PAP
Username format : Fixed account
Username : aaa
Password : ******
Offline detect period : 300 s
Quiet period : 60 s
Server timeout : 100 s
Reauth period : 3600 s
User aging period for critical VLAN : 1000 s
User aging period for critical VSI : 1000 s
User aging period for guest VLAN : 1000 s
User aging period for guest VSI : 1000 s
Authentication domain : sun
Online MAC-auth wired user : 3
Silent MAC users:
MAC address VLAN ID From port Port index
Ten-GigabitEthernet1/0/1 is link-up
MAC authentication : Enabled
Carry User-IP : Disabled
Authentication domain : Not configured
Auth-delay timer : Disabled
Periodic reauth : Disabled
Re-auth server-unreachable : Logoff
Guest VLAN : Not configured
Guest VLAN auth-period : 30
Critical VLAN : Not configured
Critical voice VLAN : Disabled
Host mode : Single VLAN
Offline detection : Enabled
Authentication order : Default
User aging : Enabled
Server-recovery online-user-sync : Enabled
Guest VSI : Not configured
Guest VSI auth-period : 30 s
Critical VSI : Not configured
Auto-tag feature : Disabled
VLAN tag configuration ignoring : Disabled
Max online users : 4294967295
Authentication attempts : successful 0, failed 0
Current online users : 3
MAC address Auth state
1234-0300-0011 authenticated
1234-0300-0012 authenticated
1234-0300-0013 authenticated
# 查看802.1X認證信息。
[Device] display dot1x interface ten-gigabitethernet 1/0/1
Global 802.1X parameters:
802.1X authentication : Enabled
CHAP authentication : Enabled
Max-tx period : 30 s
Handshake period : 15 s
Offline detect period : 300 s
Quiet timer : Disabled
Quiet period : 60 s
Supp timeout : 30 s
Server timeout : 100 s
Reauth period : 3600 s
Max auth requests : 2
User aging period for Auth-Fail VLAN : 1000 s
User aging period for Auth-Fail VSI : 1000 s
User aging period for critical VLAN : 1000 s
User aging period for critical VSI : 1000 s
User aging period for guest VLAN : 1000 s
User aging period for guest VSI : 1000 s
EAD assistant function : Disabled
EAD timeout : 30 min
Domain delimiter : @
Online 802.1X wired users : 1
Ten-GigabitEthernet1/0/1 is link-up
802.1X authentication : Enabled
Handshake : Enabled
Handshake reply : Disabled
Handshake security : Disabled
Offline detection : Disabled
Unicast trigger : Disabled
Periodic reauth : Disabled
Port role : Authenticator
Authorization mode : Auto
Port access control : MAC-based
Multicast trigger : Enabled
Mandatory auth domain : Not configured
Guest VLAN : Not configured
Auth-Fail VLAN : Not configured
Critical VLAN : Not configured
Critical voice VLAN : Disabled
Add Guest VLAN delay : Disabled
Re-auth server-unreachable : Logoff
Max online users : 4294967295
User IP freezing : Disabled
Reauth period : 0 s
Send Packets Without Tag : Disabled
Max Attempts Fail Number : 0
Guest VSI : Not configured
Auth-Fail VSI : Not configured
Critical VSI : Not configured
Add Guest VSI delay : Disabled
User aging : Enabled
Server-recovery online-user-sync : Enabled
Auth-Fail EAPOL : Disabled
Critical EAPOL : Disabled
EAPOL packets: Tx 0, Rx 0
Sent EAP Request/Identity packets : 0
EAP Request/Challenge packets: 0
EAP Success packets: 0
EAP Failure packets: 0
Received EAPOL Start packets : 0
EAPOL LogOff packets: 0
EAP Response/Identity packets : 0
EAP Response/Challenge packets: 0
Error packets: 0
Online 802.1X users: 1
配置完成後,如果有用戶認證上線,則可以通過上述顯示信息看到當前端口上的用戶認證信息。
# 此外,因為設置了Need To Know特性,目的MAC地址未知、廣播和多播報文都被丟棄。
#
mac-authentication domain sun
mac-authentication user-name-format fixed account aaa password cipher $c$3$HAlQ
nyXOwZXTgiOBPd7+kSPClKm7JbZ1Rw==
#
port-security enable
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port-security ntk-mode ntkonly
port-security max-mac-count 64
port-security port-mode mac-else-userlogin-secure
#
radius scheme radsun
primary authentication 192.168.0.38
primary accounting 192.168.0.38
key authentication cipher $c$3$s9TAYm34R8sS5k/Cylg2sDm69ZRupMvGJg==
key accounting cipher $c$3$UaUPGk8AfZAQLHFlbKNcEoM2HXGiuWowBQ==
retry 5
timer response-timeout 5
timer realtime-accounting 15
user-name-format without-domain
#
domain sun
authentication lan-access radius-scheme radsun
authorization lan-access radius-scheme radsun
accounting lan-access radius-scheme radsun
#
domain default enable sun
#
如圖9所示,客戶端通過端口Ten-GigabitEthernet1/0/1連接到Device上,Device通過RADIUS服務器(ClearPass服務器)對客戶端進行身份認證。如果認證成功,客戶端被授權允許訪問Internet資源。通過配置端口安全macAddressElseUserLoginSecureExt模式,實現對接入用戶的控製,具體需求如下:
· 可以有多個802.1X和MAC認證用戶接入,但MAC地址認證優先級大於802.1X認證;
· 802.1X用戶接入認證時,先進行MAC地址認證,如果MAC地址認證失敗再進行802.1X認證;非802.1X用戶直接進行MAC地址認證,認證成功後,服務器下發重定向URL;
· MAC地址認證設置用戶名格式為固定用戶名格式。
圖9 端口安支持ClearPass服務器下發重定向URL組網圖
· 配置交換機與用戶端相連的端口安全模式為macAddressElseUserLoginSecureExt,即:端口同時處於macAddressWithRadius模式和userLoginSecure模式,但MAC地址認證優先級大於802.1X認證。允許端口下多個802.1X和MAC地址認證用戶接入。非802.1X報文直接進行MAC地址認證;802.1X報文先進行MAC地址認證,如果MAC地址認證失敗再進行802.1X認證。
· 為實現通過端口安全的入侵檢測功能限製認證端口出方向的報文轉發。可配置NeedToKnow功能為ntkonly模式,即僅允許目的MAC地址為已通過認證的MAC地址的單播報文通過。
表4 適用產品及版本
產品 |
軟件版本 |
S6800係列 S6860係列 S6861係列 |
Release 2702 |
本舉例使用的ClearPass服務器版本為CPPM-VM-x86_64-6.5.0.71095-ESX-CP-VA-500-ovf。在進行802.1X認證功能相關配置前,請先完成ClearPass服務器的安裝和基礎配置,包括部署模板、為虛擬機添加資源、配置ClearPass管理口IP地址(本例為192.168.0.38)、配置係統時區等,有關ClearPass的基礎配置的詳細介紹請參見服務器的相關手冊。
(1) 登錄ClearPass Policy Manager(簡稱為CPPM),單擊導航樹中的[配置/網絡/設備]菜單項,選擇網絡設備,進入編輯設備詳細信息頁麵。指定作為NAS的網絡設備的IP地址(本例為192.168.0.34)、RADIUS共享密鑰(本例為expert)、供應商名稱等;開啟RADIUS CoA功能,默認RADIUS CoA端口為3799。
(2) 單擊導航樹中的[配置/網絡/設備組],添加設備組“Group1”,並進入編輯設備組頁麵,將設備IP地址(本例為192.168.0.34)加入到設備組中。
(3) 單擊導航樹中的[配置/身份/本地用戶],添加用戶“dot1x”,並進入編輯本地用戶頁麵。配置本地用戶密碼為Abc123!,選擇用戶角色為缺省角色“Employee”。
(4) 單擊導航樹中的[配置/身份/角色映射],創建角色映射“dot1x-redirect-role-map”,默認角色為Employee。在“映射規則”頁簽中創建規則,將指定規則的用戶加入到Employee角色中:
¡ 類型:Radius:IETF
¡ 名稱:User-Name
¡ 運算符:EQUALS
¡ 值:dot1x
(5) 單擊導航樹中的[配置/強製執行/配置文件],創建配置文件“dot1x”,配置重定向URL(本例中重定向URL的地址為ClearPass服務器地址),以及服務器授權下發的ACL。下發ACL是為了允許訪問重定向URL的報文通過,該ACL需在設備側配置。
¡ url-redirect=https://192.168.0.38/guest/ciscowiredguest.php?mac=%{Connection:Client-Mac-Address-Colon}
¡ url-redirect-acl=3001
(6) 單擊導航樹中的[配置/強製執行/策略],添加強製執行策略“dot1x-redirect”,並將角色“Employee”與配置文件“dot1x”綁定。
¡ 類型:Tips
¡ 名稱:Role
¡ 運算符:EQUALS
¡ 值:Employee
¡ 強製執行配置文件:[RADIUS] dot1x
(7) 單擊導航樹中的[配置/服務],添加服務“dot1x-wired-service”,並將前麵的配置項進行綁定。
¡ 在“認證”頁簽,選擇認證方法為PAP
¡ 在“授權”頁簽,增加認證源“[Guest User Respository] [Local SQL DB]”
¡ 在“角色”頁簽,選擇角色映射策略“dot1x-redirect-role-map”
¡ 在“強製執行”頁簽,選擇強製執行策略“dot1x-redirect”
配置完成後,在“概要”頁簽查看綁定結果,並單擊“保存”。
保證接入用戶和Clearpass服務器之間路由可達。
· 配置AAA
# 創建RADIUS方案。並配置RADIUS方案主認證/計費服務器及其通信密鑰。
<Device> system-view
[Device] radius scheme radsun
New RADIUS scheme.
[Device-radius-radsun] primary authentication 192.168.0.38
[Device-radius-radsun] primary accounting 192.168.0.38
[Device-radius-radsun] key authentication simple expert
[Device-radius-radsun] key accounting simple expert
# 配置係統向RADIUS服務器發送的用戶名不帶域名。
[Device-radius-radsun] user-name-format without-domain
# 配置設備發送RADIUS報文使用的源IP地址。
[Device-radius-radsun] nas-ip 192.168.0.34
[Device-radius-radsun] quit
# 創建ISP域sun,配置域內lan-access類型用戶的認證方法,並設置sun為係統缺省的ISP域。
[Device] domain sun
[Device-isp-sun] authentication lan-access radius-scheme radsun
[Device-isp-sun] authorization lan-access radius-scheme radsun
[Device-isp-sun] accounting lan-access radius-scheme radsun
[Device-isp-sun] quit
[Device] domain default enable sun
· 配置端口安全
# 全局開啟端口安全功能,並設置端口Ten-GigabitEthernet1/0/1的端口安全模式為macAddressElseUserLoginSecureExt,並配置NTK特性。
[Device] port-security enable
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] port-security port-mode mac-else-userlogin-secure-ext
[Device-Ten-GigabitEthernet1/0/1] port-security ntk-mode ntkonly
[Device-Ten-GigabitEthernet1/0/1] quit
# 配置MAC地址認證用戶名格式:用戶名為dot1x,密碼為明文的Abc123!。
[Device] mac-authentication user-name-format fixed account dot1x password simple Abc123!
# 配置802.1X的認證方式為PAP。
[Device] dot1x authentication-method pap
· 配置ACL,允許目的地址為重定向URL地址的報文通過,該ACL編號與ClearPass服務器下發的ACL一致。
[Device] acl advanced 3001
[Device-acl-ipv4-adv-3001] rule 0 permit ip destination 192.168.0.38 0
[Device-acl-ipv4-adv-3001] quit
# 查看端口安全的配置信息。
[Device] display port-security interface ten-gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
AutoLearn aging time : 0 min
Disableport timeout : 20 s
Blockmac timeout : 180 s
MAC move : Denied
Authorization fail : Online
NAS-ID profile : Not configured
Dot1x-failure trap : Disabled
Dot1x-logon trap : Disabled
Dot1x-logoff trap : Disabled
Intrusion trap : Disabled
Address-learned trap : Disabled
Mac-auth-failure trap : Disabled
Mac-auth-logon trap : Disabled
Mac-auth-logoff trap : Disabled
Open authentication : Disabled
OUI value list :
Ten-GigabitEthernet1/0/1 is link-up
Port mode : macAddressElseUserloginSecureExt
NeedToKnow mode : NeedToKnowOnly
Intrusion protection mode : NoAction
Security MAC address attribute
Learning mode : Sticky
Aging type : Periodical
Max secure MAC addresses : Not configured
Current secure MAC addresses : 0
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
# 查看MAC地址認證信息。
[Device] display mac-authentication interface ten-gigabitethernet 1/0/1
Global MAC authentication parameters:
MAC authentication : Enabled
Authentication method : PAP
Username format : Fixed account
Username : dot1x
Password : ******
Offline detect period : 300 s
Quiet period : 60 s
Server timeout : 100 s
Reauth period : 3600 s
User aging period for critical VLAN : 1000 s
User aging period for critical VSI : 1000 s
User aging period for guest VLAN : 1000 s
User aging period for guest VSI : 1000 s
Authentication domain : sun
Online MAC-auth wired users : 1
Silent MAC users:
MAC address VLAN ID From port Port index
Ten-GigabitEthernet1/0/1 is link-up
MAC authentication : Enabled
Carry User-IP : Disabled
Authentication domain : sun
Auth-delay timer : Disabled
Periodic reauth : Disabled
Re-auth server-unreachable : Logoff
Guest VLAN : Not configured
Guest VLAN auth-period : 30 s
Critical VLAN : Not configured
Critical voice VLAN : Disabled
Host mode : Single VLAN
Offline detection : Enabled
Authentication order : Default
User aging : Enabled
Server-recovery online-user-sync : Enabled
Guest VSI : Not configured
Guest VSI auth-period : 30 s
Critical VSI : Not configured
Auto-tag feature : Disabled
VLAN tag configuration ignoring : Disabled
Max online users : 4294967295
Authentication attempts : successful 5, failed 38
Current online users : 1
MAC address Auth state
acf1-df6c-ff48 Authenticated
# 查看802.1X認證信息。
[Device] display dot1x interface ten-gigabitethernet 1/0/1
Global 802.1X parameters:
802.1X authentication : Enabled
PAP authentication : Enabled
Max-tx period : 30 s
Handshake period : 15 s
Offline detect period : 300 s
Quiet timer : Disabled
Quiet period : 60 s
Supp timeout : 30 s
Server timeout : 100 s
Reauth period : 3600 s
Max auth requests : 2
User aging period for Auth-Fail VLAN : 1000 s
User aging period for Auth-Fail VSI : 1000 s
User aging period for critical VLAN : 1000 s
User aging period for critical VSI : 1000 s
User aging period for guest VLAN : 1000 s
User aging period for guest VSI : 1000 s
EAD assistant function : Disabled
EAD timeout : 30 min
Domain delimiter : @
Online 802.1X wired users : 0
Ten-GigabitEthernet1/0/1 is link-up
802.1X authentication : Enabled
Handshake : Enabled
Handshake reply : Disabled
Handshake security : Disabled
Offline detection : Disabled
Unicast trigger : Disabled
Periodic reauth : Disabled
Port role : Authenticator
Authorization mode : Auto
Port access control : MAC-based
Multicast trigger : Enabled
Mandatory auth domain : Not configured
Guest VLAN : Not configured
Auth-Fail VLAN : Not configured
Critical VLAN : Not configured
Critical voice VLAN : Disabled
Add Guest VLAN delay : Disabled
Re-auth server-unreachable : Logoff
Max online users : 4294967295
User IP freezing : Disabled
Reauth period : 0 s
Send Packets Without Tag : Disabled
Max Attempts Fail Number : 0
Guest VSI : Not configured
Auth-Fail VSI : Not configured
Critical VSI : Not configured
Add Guest VSI delay : Disabled
User aging : Enabled
Server-recovery online-user-sync : Enabled
Auth-Fail EAPOL : Disabled
Critical EAPOL : Disabled
EAPOL packets: Tx 165, Rx 0
Sent EAP Request/Identity packets : 165
EAP Request/Challenge packets: 0
EAP Success packets: 0
EAP Failure packets: 0
Received EAPOL Start packets : 0
EAPOL LogOff packets: 0
EAP Response/Identity packets : 0
EAP Response/Challenge packets: 0
Error packets: 0
Online 802.1X users: 0
# 配置完成後,如果有用戶認證上線,則可以通過上述顯示信息看到當前端口上的用戶認證信息。
<Device>display mac-authentication connection
Total connections: 1
Slot ID: 2
User MAC address: acf1-df6c-ff48
Access interface: Ten-GigabitEthernet1/0/1
Username: dot1x
User access state: Successful
Authentication domain: sun
IPv4 address: 192.168.1.5
Initial VLAN: 4
Authorization untagged VLAN: N/A
Authorization tagged VLAN: N/A
Authorization VSI: N/A
Authorization ACL ID: 3001
Authorization user profile: N/A
Authorization CAR: N/A
Authorization URL: https://192.168.0.38/guest/ciscowiredguest.php?mac=ac:f1:df:6c:ff:48
Termination action: Default
Session timeout period: N/A
Online from: 2018/03/02 12:52:17
Online duration: 0h 11m 12s
此外,因為設置了Need To Know特性,目的MAC地址未知、廣播和多播報文都被丟棄。
#
dot1x authentication-method pap
#
mac-authentication user-name-format fixed account dot1x password cipher $c$3$HAlQ
nyXOwZXTgiOBPd7+kSPClKm7JbZ1Rw==
#
port-security enable
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port-security ntk-mode ntkonly
port-security port-mode mac-else-userlogin-secure-ext
#
acl advanced 3001
rule 0 permit ip destination 192.168.0.38 0
#
radius scheme radsun
primary authentication 192.168.0.38
primary accounting 192.168.0.38
key authentication cipher $c$3$s9TAYm34R8sS5k/Cylg2sDm69ZRupMvGJg==
key accounting cipher $c$3$UaUPGk8AfZAQLHFlbKNcEoM2HXGiuWowBQ==
retry 5
user-name-format without-domain
nas-ip 192.168.0.34
#
domain sun
authentication lan-access radius-scheme radsun
authorization lan-access radius-scheme radsun
accounting lan-access radius-scheme radsun
#
domain default enable sun
#
· H3C S6800[60][61](R27xx) & S6820(R630x)係列以太網交換機 安全配置指導
· H3C S6800[60][61](R27xx) & S6820(R630x)係列以太網交換機 安全命令參考
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!