05-端口安全配置
本章節下載: 05-端口安全配置 (828.79 KB)
目 錄
1.9 配置指定VLAN內端口安全功能允許同時接入的最大MAC地址數
1.13 配置允許MAC遷移同步的遠端MAC表項覆蓋本端的原MAC表項
1.28.2 端口安全userLoginWithOUI模式配置舉例
1.28.3 端口安全macAddressElseUserLoginSecure模式配置舉例
端口安全是一種基於MAC地址對網絡接入進行控製的安全機製,是對已有的802.1X認證和MAC地址認證的擴充。這種機製通過檢測端口收到的數據幀中的源MAC地址來控製非授權設備或主機對網絡的訪問,通過檢測從端口發出的數據幀中的目的MAC地址來控製對非授權設備的訪問。
端口安全的主要功能是通過定義各種端口安全模式,讓設備學習到合法的源MAC地址,以達到相應的網絡管理效果。啟動了端口安全功能之後,當發現非法報文時,係統將觸發相應特性,並按照預先指定的方式進行處理,既方便用戶的管理又提高了係統的安全性。這裏的非法報文是指:
· MAC地址未被端口學習到的用戶報文;
· 未通過認證的用戶報文。
由於端口安全特性通過多種安全模式提供了802.1X和MAC地址認證的擴展和組合應用,因此在需要靈活使用以上兩種認證方式的組網環境下,推薦使用端口安全特性。無特殊組網要求的情況下,無線環境中通常使用端口安全特性。而在僅需要802.1X、MAC地址認證特性來完成接入控製的組網環境下,推薦單獨使用相關特性。關於802.1X、MAC地址認證特性的詳細介紹和具體配置請參見“安全配置指導”中的“802.1X”、“MAC地址認證”。
Need To Know特性通過檢測從端口發出的數據幀的目的MAC地址,保證數據幀隻能被發送到已經通過認證或被端口學習到的MAC所屬的設備或主機上,從而防止非法設備竊聽網絡數據。
入侵檢測特性指通過檢測從端口收到的數據幀的源MAC地址,對接收非法報文的端口采取相應的安全策略,包括端口被暫時斷開連接、永久斷開連接或MAC地址被阻塞一段時間,以保證端口的安全性。
端口安全模式可大致分為兩大類:控製MAC學習類和認證類。
· 控製MAC學習類:無需認證,包括端口自動學習MAC地址和禁止MAC地址學習兩種模式。
· 認證類:利用MAC地址認證和802.1X認證機製來實現,包括單獨認證和組合認證等多種模式。
配置了安全模式的端口上收到用戶報文後,首先查找MAC地址表,如果該報文的源MAC地址已經存在於MAC地址表中,則端口轉發該報文,否則根據端口所采用的安全模式進行相應的處理,並在發現非法報文後觸發端口執行相應的安全防護措施(Need To Know、入侵檢測)或發送Trap告警。缺省情況下,端口出方向的報文轉發不受端口安全限製,若觸發了端口Need To Know,則才受相應限製。關於各模式的具體工作機製,以及是否觸發Need To Know、入侵檢測的具體情況請參見表1-1。
端口安全采用方式 |
安全模式 |
觸發的安全防護措施 |
|
關閉端口安全特性 |
noRestrictions(缺省情況) 表示端口的安全功能關閉,端口處於無限製狀態 |
無 |
|
autoLearn |
NTK/入侵檢測 |
||
secure |
|||
userLogin |
NTK(ntkauto方式) |
||
userLoginSecure |
NTK/入侵檢測 |
||
userLoginSecureExt |
|||
userLoginWithOUI |
|||
macAddressWithRadius |
NTK/入侵檢測 |
||
Or |
macAddressOrUserLoginSecure |
NTK/入侵檢測 |
|
macAddressOrUserLoginSecureExt |
|||
Else |
macAddressElseUserLoginSecure |
||
macAddressElseUserLoginSecureExt |
|||
And |
macAddressAndUserLoginSecureExt |
· 當多個用戶通過認證時,端口下所允許的最大用戶數與端口安全模式相關,取端口安全所允許的最大安全MAC地址數與相應模式下允許認證用戶數的最小值。例如,userLoginSecureExt模式下,端口下所允許的最大用戶為配置的端口安全所允許的最大安全MAC地址數與802.1X認證所允許的最大用戶數的最小值。
· 手工配置MAC地址的具體介紹請參見“二層技術-以太網交換命令參考”中的“MAC地址表”。
由於安全模式種類較多,為便於記憶,部分端口安全模式的名稱可按如下規則理解:
· “userLogin”表示基於端口的802.1X認證。userLogin之後,若攜帶“Secure”,則表示基於MAC地址的802.1X認證;若攜帶“Ext”,則表示可允許多個802.1X用戶認證成功,否則表示僅允許一個802.1X用戶認證成功。
· “macAddress”表示MAC地址認證;
· “Else”之前的認證方式先被采用,失敗後根據請求認證的報文協議類型決定是否轉為“Else”之後的認證方式。
· “Or”之後的認證方式先被采用,失敗後轉為“Or”之前的認證方式。
· “And”之前的認證方式先被采用,成功後再根據請求認證的報文協議類型進行“And”之後的認證方式。
· autoLearn
該模式下,端口不會將自動學習到的MAC地址添加為MAC地址表中的動態MAC地址,而是將這些地址添加到安全MAC地址表中,稱之為安全MAC地址。也可以通過port-security mac-address security命令手工配置端口下的安全MAC地址。
隻有源MAC地址為安全MAC地址、通過命令mac-address dynamic或mac-address static手工配置的MAC地址的報文,才能通過該端口。當端口下的安全MAC地址數超過端口安全允許學習的最大安全MAC地址數後,端口模式會自動轉變為secure模式。之後,該端口停止添加新的安全MAC。
· secure
該模式下,禁止端口學習MAC地址,隻有源MAC地址為端口上的安全MAC地址、通過命令mac-address dynamic或mac-address static手工配置的MAC地址的報文,才能通過該端口。有關MAC地址的詳細配置,請參見“二層技術-以太網交換”中的“MAC地址表”。
· userLogin
此模式下,端口對接入用戶采用基於端口的802.1X認證方式。端口下支持接入多個802.1X用戶,且第一個802.1X用戶認證成功後,其它用戶無須認證就可接入。
· userLoginSecure
此模式下,端口對接入用戶采用基於MAC地址的802.1X認證方式,且最多隻允許一個802.1X認證用戶接入。
· userLoginSecureExt
該模式與userLoginSecure模式類似,但端口支持多個802.1X認證用戶接入。
· userLoginWithOUI
該模式與userLoginSecure模式類似,但端口上除了允許一個802.1X認證用戶接入之外,還額外允許一個特殊用戶接入,該用戶報文的源MAC的OUI與設備上配置的OUI值相符。
此模式下,報文首先進行OUI匹配,OUI匹配失敗的報文再進行802.1X認證,OUI匹配成功和802.1X認證成功的報文都允許通過端口。
OUI(Organizationally Unique Identifier,全球統一標識符)是MAC地址的前24位(二進製),是IEEE(Institute of Electrical and Electronics Engineers,電氣和電子工程師學會)為不同設備供應商分配的一個全球唯一的標識符。
macAddressWithRadius:端口對接入用戶采用MAC地址認證,且允許多個用戶接入。
· macAddressOrUserLoginSecure
端口同時處於userLoginSecure模式和macAddressWithRadius模式,且允許一個802.1X認證用戶及多個MAC地址認證用戶接入。
此模式下,802.1X認證優先級大於MAC地址認證:報文首先觸發802.1X認證,默認情況下,如果802.1X認證失敗再進行MAC地址認證;若開啟了端口的MAC地址認證和802.1X認證並行處理功能,則端口配置了802.1X單播觸發功能的情況下,當端口收到源MAC地址未知的報文,會向該MAC地址單播發送EAP-Request幀來觸發802.1X認證,但不等待802.1X認證處理完成,就同時進行MAC地址認證。
· macAddressOrUserLoginSecureExt
與macAddressOrUserLoginSecure類似,但允許端口下有多個802.1X和MAC地址認證用戶。
· macAddressElseUserLoginSecure
端口同時處於macAddressWithRadius模式和userLoginSecure模式,但MAC地址認證優先級大於802.1X認證。允許端口下一個802.1X認證用戶及多個MAC地址認證用戶接入。
非802.1X報文直接進行MAC地址認證。802.1X報文先進行MAC地址認證,如果MAC地址認證失敗再進行802.1X認證。
· macAddressElseUserLoginSecureExt
與macAddressElseUserLoginSecure類似,但允許端口下有多個802.1X和MAC地址認證用戶。
· macAddressAndUserLoginSecureExt
此模式下,對接入用戶先進行MAC地址認證,認證成功後作為臨時MAC地址認證用戶,僅能訪問802.1X Guest VLAN的資源。之後,端口收到同一MAC地址用戶的802.1X協議報文時,再進行802.1X認證。802.1X認證成功後,臨時MAC地址認證用戶下線,802.1X用戶上線成功。
如圖1-1所示,Device A與Device B形成負載分擔,共同進行流量轉發,當其中一台設備發生故障時,流量可以快速切換到另一台設備,保證業務的正常運行。
在M-LAG組網中,端口安全支持配置M-LAG接口上用戶認證的負載分擔模式。為保證所有M-LAG接口上送的用戶報文都有M-LAG設備進行認證處理,且同一用戶的報文同時隻在一台M-LAG設備上進行認證處理,端口安全支持如下三種負載分擔模式:
· 集中處理模式:該模式下,本端和對端M-LAG接口上送的用戶報文都集中到M-LAG主設備處理。
· 分布處理模式:該模式下,M-LAG接口上的用戶報文根據分布規則分布到兩台M-LAG設備上處理。
¡ 本地模式:分布處理本地上送的用戶報文,本端M-LAG接口上送的用戶報文在本端M-LAG設備處理。
¡ 奇偶模式:分布處理本端M-LAG設備和對端M-LAG設備上送的奇偶MAC用戶報文。此模式下,兩台設備需配置不同的處理模式,若一端設備配置處理奇MAC報文,另一端則需配置為處理偶MAC報文。
當M-LAG接口相連的接入設備上選擇了不同的聚合負載分擔類型時,通過選擇相應的端口安全負載分擔模式,可以滿足各種聚合負載分擔場景下的認證業務需要。
配置M-LAG接口上用戶認證的負載分擔模式後,若用戶在本端M-LAG設備上通過認證,需要將用戶數據同步發送到對端M-LAG設備進行備份。當一端M-LAG設備發生故障時,對端M-LAG設備可以使用備份的用戶數據接替處理業務,從而保證用戶業務的正常運行。
圖1-1 端口安全支持M-LAG組網示意圖
· 端口安全的secure、userlogin-withoui模式不支持在二層以太網聚合接口配置。其餘支持配置端口安全功能的端口均可為二層以太網接口和二層聚合接口。
· 二層以太網接口加入聚合組後,在該接口上配置的端口安全功能不生效。
· 在二層聚合接口上有802.1X或MAC地址認證用戶在線的情況下,請不要刪除該二層聚合接口。
· M-LAG場景下,在設備上開啟RADIUS DAE服務後,設備不支持通過COA請求報文關閉/重啟802.1X、MAC地址認證和Web認證用戶接入端口或重認證用戶。關於RADIUS DAE服務詳細信息請參見“安全配置指導”中的“AAA”。
· 當用戶認證成功後被授權重定向URL或設備上開啟EAD快速部署功能時,用戶報文進入的VLAN裏必須有三層接口(比如VLAN接口)存在,否則將導致HTTPS重定向失敗。
表1-2 端口安全配置任務簡介
配置任務 |
說明 |
詳細配置 |
||
使能端口安全 |
必選 |
|||
配置端口安全允許的最大安全MAC地址數 |
可選 |
|||
配置端口安全模式 |
必選 |
|||
配置端口安全的特性 |
配置Need To Know特性 |
根據實際組網需求選擇其中一種或多種特性 |
||
配置入侵檢測模式 |
||||
配置安全MAC地址 |
可選 |
|||
配置指定VLAN內端口安全功能允許同時接入的最大MAC地址數 |
可選 |
|||
配置M-LAG接口上用戶認證的負載分擔模式 |
僅在M-LAG組網中需要完成本配置 |
|||
配置端口安全擴展功能 |
配置當前端口不應用下發的授權信息 |
可選 以上端口安全擴展功能,在未使能端口安全,但開啟802.1X或MAC地址認證功能的情況下也適用。 |
||
配置允許MAC遷移功能 |
||||
配置允許MAC遷移同步的遠端MAC表項覆蓋本端的原MAC表項 |
||||
配置授權失敗用戶下線功能 |
||||
配置開放認證模式 |
||||
配置端口安全的Free VLAN功能 |
||||
配置NAS-ID Profile |
||||
配置端口安全接入用戶流量統計 |
可選 |
|||
配置端口安全告警功能 |
可選 |
|||
配置端口的認證順序 |
可選 |
|||
配置端口安全用戶的認證前域 |
可選 |
|||
配置端口安全用戶重定向URL不可達時的逃生域 |
可選 |
|||
配置端口接入認證的靜態用戶 |
可選 |
|||
配置端口非認證成功在線用戶定時器的值 |
可選 |
|||
配置允許用戶在隔離組的成員端口間免認證遷移 |
可選 |
|||
配置端口安全接入用戶日誌信息功能 |
可選 |
|||
在使能端口安全之前,需要關閉全局的802.1X和MAC地址認證。
當端口安全處於使能狀態時,不能開啟端口上的802.1X以及MAC地址認證,且不能修改802.1X端口接入控製方式和端口授權狀態,它們隻能隨端口安全模式的改變由係統更改。
表1-3 使能端口安全
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
使能端口安全 |
port-security enable |
缺省情況下,端口安全處於關閉狀態 |
可以通過undo port-security enable命令關閉端口安全。但需要注意的是,在端口上有用戶在線的情況下,關閉端口安全會導致在線用戶下線。
執行使能或關閉端口安全的命令後,端口上的如下配置會被自動恢複為以下缺省情況:
· 802.1X端口接入控製方式為macbased;
· 802.1X端口的授權狀態為auto。
有關802.1X認證配置的詳細介紹可參見“安全配置指導”中的“802.1X”。有關MAC地址認證配置的詳細介紹可參見“安全配置指導”中的“MAC地址認證”。
端口安全允許某個端口下有多個用戶接入,但是允許的用戶數不能超過規定的最大值。
配置端口允許的最大安全MAC地址數有兩個作用:
· 控製端口允許接入網絡的最大用戶數。對於采用802.1X、MAC地址認證或者兩者組合形式的認證類安全模式,端口允許的最大用戶數取本命令配置的值與相應模式下允許認證用戶數的最小值;
· 控製autoLearn模式下端口能夠添加的最大安全MAC地址數。
端口安全允許的最大安全MAC地址數與“二層技術-以太網交換配置指導/MAC地址表”中配置的端口最多可以學習到的MAC地址數無關,且不受其影響。
對於autolearn模式,還可以配置指定VLAN內允許的最大安全MAC地址數。當不指定具體的VLAN時,表示的是接口允許的每個VLAN內的最大安全MAC地址數;否則表示指定VLAN內的最大安全MAC地址數。當VLAN內的MAC地址數達到最大限製時,會觸發入侵檢測。
表1-4 配置端口安全允許的最大安全MAC地址數
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
配置端口安全允許的最大安全MAC地址數 |
port-security max-mac-count max-count [ vlan [ vlan-id-list ] ] |
缺省情況下,端口安全不限製本端口可保存的最大安全MAC地址數 |
· 在端口安全未使能的情況下,端口安全模式可以進行配置但不會生效。
· 端口上有用戶在線的情況下,改變端口的安全模式會導致在線用戶會下線。
· 端口安全模式為mac-authentication、mac-else-userlogin-secure、mac-else-userlogin-secure-ext、userlogin-secure、userlogin-secure-ext、userlogin-secure-or-mac、userlogin-secure-or-mac-ext或userlogin-withoui時,設備支持RADIUS擴展屬性下發重定向URL。即:用戶認證後,設備會根據RADIUS服務器下發的重定向URL屬性,將用戶的HTTP或HTTPS請求重定向到指定的Web認證頁麵。Web認證通過後,RADIUS服務器記錄用戶的MAC地址,並通過DM報文強製Web用戶下線。此後該用戶再次發起802.1X認證或MAC地址認證,由於RADIUS服務器上已記錄該用戶和其MAC地址的對應信息,用戶可以成功上線。
· 端口安全模式為macAddressAndUserLoginSecureExt時,為了保證802.1X客戶端可以發起認證,建議通過dot1x unicast-trigger命令開啟端口上的802.1X單播觸發功能。此模式下,MAC地址認證的Guest VLAN不生效,如有需要請配置802.1X Guest VLAN。此外,配置本模式後,如果不需要對臨時MAC地址認證用戶進行計費,請單獨為MAC地址認證用戶配置ISP域,並指定計費方式為不計費。
· 若需要對用戶的HTTPS請求進行重定向,需要在設備上配置對HTTPS報文進行重定向的內部偵聽端口號,具體配置請參見“三層技術-IP業務配置指導”中的“HTTP重定向”。
(1) 在配置端口安全模式之前,端口上首先需要滿足以下條件:
· 802.1X認證關閉。
· MAC地址認證關閉。
· 端口未加入聚合組或業務環回組。
如果端口上已經配置了端口安全模式,則不允許開啟802.1X認證和MAC地址認證。
(2) 對於autoLearn模式,還需要提前設置端口安全允許的最大安全MAC地址數。但是如果端口已經工作在autoLearn模式下,則無法更改端口安全允許的最大安全MAC地址數。
表1-5 配置端口安全模式
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
(可選)配置允許通過認證的用戶OUI值 |
port-security oui index index-value mac-address oui-value |
該命令僅在配置userlogin-withoui安全模式時必選 缺省情況下,不存在允許通過認證的用戶OUI值 允許通過認證的用戶OUI值可以配置多個,但在端口安全模式為userLoginWithOUI時,端口除了可以允許一個802.1X的接入用戶通過認證之外,僅允許一個與某OUI值匹配的用戶通過認證 |
進入接口視圖 |
interface interface-type interface-number |
· autoLearn模式隻能在二層以太網接口下配置 · userloginWithOUI模式隻能在二層以太網下配置 |
配置端口的安全模式 |
port-security port-mode { autolearn | mac-and-userlogin-secure-ext | mac-authentication | mac-else-userlogin-secure | mac-else-userlogin-secure-ext | secure | userlogin | userlogin-secure | userlogin-secure-ext | userlogin-secure-or-mac | userlogin-secure-or-mac-ext | userlogin-withoui } |
缺省情況下,端口處於noRestrictions模式 當端口安全已經使能且當前端口安全模式不是noRestrictions時,若要改變端口安全模式,必須首先執行undo port-security port-mode命令恢複端口安全模式為noRestrictions模式 |
OUI(Organizationally Unique Identifier,全球統一標識符)是MAC地址的前24位(二進製),是IEEE(Institute of Electrical and Electronics Engineers,電氣和電子工程師學會)為不同設備供應商分配的一個全球唯一的標識符。
Need To Know特性用來限製端口上出方向的報文轉發,可支持以下幾種限製方式:
· ntkonly:僅允許目的MAC地址為已知MAC地址的單播報文通過。
· ntk-withbroadcasts:允許廣播地址報文、目的MAC地址為已知MAC地址的單播報文通過。
· ntk-withmulticasts:允許廣播地址報文、組播地址報文和目的MAC地址為已知MAC地址的單播報文通過。
· ntkauto:僅當有用戶認證上線後,才允許廣播地址報文、組播地址報文和目的MAC地址為已知MAC地址的單播報文通過。
配置了Need To Know的端口在以上任何一種方式下都不允許目的MAC地址未知的單播報文通過。
並非所有的端口安全模式都支持Need To Know特性,配置時需要先了解各模式對此特性的支持情況,具體請參見表1-1。
表1-6 配置Need To Know特性
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
配置端口Need To Know特性 |
port-security ntk-mode { ntk-withbroadcasts | ntk-withmulticasts | ntkauto | ntkonly } |
缺省情況下,端口沒有配置Need To Know特性,即所有報文都可成功發送 |
當設備檢測到一個非法的用戶通過端口試圖訪問網絡時,入侵檢測特性用於配置設備可能對其采取的安全措施,包括以下三種方式:
· blockmac:表示將非法報文的源MAC地址加入阻塞MAC地址列表中,源MAC地址為阻塞MAC地址的報文將被丟棄。此MAC地址在被阻塞一段時間後恢複正常。阻塞時長可通過port-security timer blockmac命令配置。
· disableport:表示將收到非法報文的端口永久關閉。
· disableport-temporarily:表示將收到非法報文的端口暫時關閉一段時間。關閉時長可通過port-security timer disableport命令配置。
表1-7 配置入侵檢測特性
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
配置入侵檢測特性 |
port-security intrusion-mode { blockmac | disableport | disableport-temporarily } |
缺省情況下,不進行入侵檢測處理 |
退回係統視圖 |
quit |
- |
(可選)配置係統暫時關閉端口的時間 |
port-security timer disableport time-value |
缺省情況下,係統暫時關閉端口的時間為20秒 |
(可選)配置將非法報文的源MAC地址加入阻塞MAC地址列表的時間 |
port-security timer blockmac time-value |
缺省情況下,將非法報文的源MAC地址加入阻塞MAC地址列表的時間為180秒 |
macAddressElseUserLoginSecure或macAddressElseUserLoginSecureExt安全模式下工作的端口,對於同一個報文,隻有MAC地址認證和802.1X認證均失敗後,才會觸發入侵檢測特性。
安全MAC地址是一種特殊的MAC地址,保存配置後重啟設備,不會丟失。在同一個VLAN內,一個安全MAC地址隻能被添加到一個端口上。
安全MAC地址可以通過以下兩種途徑生成:
· 由autoLearn安全模式下的使能端口安全功能的端口自動學習。
· 通過命令行手動添加。
缺省情況下,所有的安全MAC地址均不老化,除非被管理員通過命令行手工刪除,或因為配置的改變(端口的安全模式被改變,或端口安全功能被關閉)而被係統自動刪除。但是,安全MAC地址不老化會帶來一些問題:合法用戶離開端口後,若有非法用戶仿冒合法用戶源MAC接入,會導致合法用戶不能繼續接入;雖然該合法用戶已離開,但仍然占用端口MAC地址資源,而導致其它合法用戶不能接入。因此,讓某一類安全MAC地址能夠定期老化,可提高端口接入的安全性和端口資源的利用率。
表1-8 安全MAC地址相關屬性列表
類型 |
生成方式 |
配置保存機製 |
老化機製 |
靜態 |
手工添加(未指定sticky關鍵字) |
安全MAC地址在保存配置文件並重啟設備後,仍然存在 |
不老化 |
Sticky |
手工添加(指定sticky關鍵字),或端口自動學習 |
Sticky MAC地址在保存配置文件並重啟設備後,仍然存在,且其老化定時器會重新開始計時 Sticky MAC地址可通過配置轉換為動態類型的MAC地址。動態類型的安全MAC地址不能被保存在配置文件中,設備重啟後會被丟失 |
支持兩種老化機製: · 定時老化。若老化時間為0,則表示不老化(缺省) · 無流量老化。設備會定期檢測(檢測周期不可配)端口上的安全MAC地址是否有流量產生,若某安全MAC地址在配置的Sticky MAC地址老化時間內沒有任何流量產生,則才會被老化 |
當端口下的安全MAC地址數目超過端口允許學習的最大安全MAC地址數後,該端口不會再添加新的安全MAC地址,僅接收並允許數據幀中的源MAC地址為以下兩類MAC地址的報文訪問網絡設備:
· 安全MAC地址
· 通過命令mac-address dynamic或mac-address static配置的MAC地址
在配置安全MAC地址之前,需要完成以下配置任務:
· 使能端口安全功能
· 設置端口安全允許的最大MAC地址數
· 配置端口安全模式為autoLearn
· 當前的接口必須允許指定的VLAN通過或已加入該VLAN,且該VLAN已存在
表1-9 配置安全MAC地址
操作 |
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
|
(可選)配置安全MAC地址的老化時間 |
port-security timer autolearn aging [ second ] time-value |
缺省情況下,安全MAC地址不會老化 |
|
配置安全MAC地址 |
在係統視圖下 |
port-security mac-address security [ sticky ] mac-address interface interface-type interface-number vlan vlan-id |
二者選其一 缺省情況下,未配置安全MAC地址 與相同VLAN綁定的同一個MAC地址不允許同時指定為靜態類型的安全MAC地址和Sticky MAC地址 |
在接口視圖下 |
interface interface-type interface-number |
||
port-security mac-address security [ sticky ] mac-address vlan vlan-id |
|||
進入接口視圖 |
interface interface-type interface-number |
- |
|
(可選)配置安全地址的老化方式為無流量老化 |
port-security mac-address aging-type inactivity |
缺省情況下,安全MAC地址按照固定時間進行老化,即在配置的安全MAC地址的老化時間到達後立即老化 |
|
(可選)將Sticky MAC地址設置為動態類型的安全MAC地址 |
port-security mac-address dynamic |
缺省情況下,Sticky MAC地址能夠被保存在配置文件中,設備重啟後也不會丟失 |
通常情況下,端口上端口安全功能允許接入的MAC地址包括:
· 端口上MAC地址認證成功用戶的MAC地址,MAC地址認證Guest VLAN、Critical VLAN中用戶的MAC地址;MAC地址認證Critical微分段中的用戶的MAC地址。
· 802.1X認證成功用戶的MAC地址、802.1X認證Guest VLAN、Auth-Fail VLAN、Critical VLAN中用戶的MAC地址。
· Web認證成功用戶的MAC地址;Web認證Auth-Fail VLAN中用戶的MAC地址。
由於係統資源有限,如果當前端口上允許接入的MAC地址數過多,接入MAC地址之間會發生資源的爭用,因此適當地配置端口安全功能允許同時接入的最大MAC地址數可以使屬於當前端口的用戶獲得可靠的性能保障。當指定VLAN內,端口允許接入的MAC地址數超過最大值後,該VLAN內新接入的MAC地址將被拒絕。
配置的端口上指定VLAN內端口安全功能允許同時接入的最大MAC地址數,不能小於當前端口上相應VLAN已存在的MAC地址數;否則,本次配置不生效。
表1-10 配置指定VLAN內端口安全功能允許同時接入的最大MAC地址數
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
配置指定VLAN內端口安全功能允許同時接入的最大MAC地址數 |
port-security mac-limit max-number per-vlan vlan-id-list |
缺省情況下,端口上端口安全功能允許同時接入的最大MAC地址數為2147483647 |
為保證所有M-LAG接口上送的用戶報文都有M-LAG設備處理,且同一用戶的報文同時隻在一台M-LAG設備上處理,可以按如下方式配置兩台M-LAG設備上的用戶認證的負載分擔模式:
· 兩台M-LAG設備都配置集中處理模式。
· 兩台M-LAG設備都配置分布處理模式且分布規則為local。
· 兩台M-LAG設備都配置分布處理模式且其中一台M-LAG設備配置分布規則為odd-mac,另一台M-LAG設備配置分布規則為even-mac。
· 本命令僅對802.1X、MAC地址認證和Web認證用戶生效。
· M-LAG場景下,兩台M-LAG設備通過交換各自的配置信息,檢查配置是否衝突,檢查過程不影響M-LAG設備轉發報文。若配置衝突,將不允許新用戶上線。
· 為防止配置衝突導致用戶下線,請勿在端口安全、802.1X、MAC地址認證或Web認證使能的情況下,修改M-LAG接口上用戶認證的負載分擔模式配置。
· 當指定M-LAG接口上用戶認證的負載分擔模式為local時,必須保證與M-LAG接口相連的接入設備上配置的聚合負載分擔類型為按報文的目的IP地址進行聚合負載分擔、按報文的目的MAC地址進行聚合負載分擔、按報文的源IP地址進行聚合負載分擔或按報文的源MAC地址進行聚合負載分擔,否則會導致用戶數據處理異常。
· 對於802.1X認證場景,還必須保證與M-LAG接口相連的接入設備上配置缺省聚合負載分擔時忽略除報文的源MAC地址之外的其它字段。
· 集中處理模式下,如果M-LAG接口單邊接入,即當前M-LAG係統中僅一台M-LAG設備配置了M-LAG接口且由該M-LAG接口轉發流量,則端口安全不允許用戶從該M-LAG口上線。因此,在M-LAG接口單邊接入的情況下,為了保證用戶能夠正常上線,請不要配置集中處理模式。
關於M-LAG的詳細介紹請參見“二層技術-以太網交換配置指導”中的“M-LAG”,關於聚合負載分擔的詳細介紹請參見“二層技術-以太網交換配置指導”中的“以太網鏈路聚合”
表1-11 配置M-LAG接口上用戶認證的負載分擔模式
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置M-LAG接口上用戶認證的負載分擔模式 |
port-security m-lag load-sharing-mode { centralized | distributed { even-mac | local | odd-mac } } |
缺省情況下,M-LAG接口上用戶認證的負載分擔模式為集中處理模式 |
802.1X用戶或MAC地址認證用戶通過本地認證或RADIUS認證時,本地設備或遠程RADIUS服務器會把授權信息下發給用戶。通過此配置可實現端口是否忽略這類下發的授權信息。
表1-12 配置當前端口不應用下發的授權信息
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
配置當前端口不應用RADIUS服務器或設備本地下發的授權信息 |
port-security authorization ignore |
缺省情況下,端口應用RADIUS服務器或設備本地下發的授權信息 |
允許MAC遷移功能是指,允許在線的802.1X用戶、MAC地址認證用戶或Web認證用戶遷移到設備的其它端口上或遷移到同一端口下的其它VLAN接入後可以重新認證上線。
對於遷移到設備其它端口接入的用戶,缺省情況下,如果用戶從某一端口上線成功,則該用戶在未從當前端口下線的情況下無法在設備的其它端口上(無論該端口是否與當前端口屬於同一VLAN)發起認證,也無法上線。若開啟了允許MAC地址遷移功能,則允許在線用戶離開當前端口在設備的其它端口上(無論該端口是否與當前端口屬於同一VLAN)發起認證。如果該用戶在後接入的端口上認證成功,則當前端口會將該用戶立即進行下線處理,保證該用戶僅在一個端口上處於上線狀態。
對於Trunk和Hybrid端口下的用戶,在用戶報文攜帶VLAN Tag時可以遷移到同一端口下的其它VLAN內接入。缺省情況下,如果用戶從端口下的某個VLAN上線成功,則當該用戶遷移到同一端口下的其它VLAN內發起認證,用戶認證失敗。若開啟了允許MAC地址遷移功能,則用戶在新VLAN可以認證成功,並且端口會對遷移前的在線用戶立即進行下線處理,保證該用戶僅在一個VLAN上處於上線狀態。
缺省情況下,端口開啟MAC VLAN功能後,若用戶上線成功並授權了VLAN,則當用戶通過MAC遷移方式在其它端口上線時,用戶發送的802.1X、MAC地址認證或Web認證報文中會攜帶初始認證端口授權的VLAN信息。此時新端口會對用戶認證的報文中攜帶的VLAN信息進行檢查,如果用戶所在VLAN不在新端口允許通過的VLAN範圍內,則不允許用戶進行MAC遷移。為了避免這種情況的發生,可以開啟允許MAC遷移不檢查VLAN功能。
配置允許MAC遷移功能,需要注意的是:
· 通常,不建議開啟該功能,隻有在用戶漫遊遷移需求的情況下建議開啟此功能。
· 如果用戶進行MAC地址遷移前,服務器在線用戶數已達到上限,則用戶MAC地址遷移不成功。
· 對於遷移到同一端口下的其它VLAN內接入的用戶,MAC地址認證的多VLAN模式優先級高於MAC遷移功能。當開啟端口的多VLAN模式(通過mac-authentication host-mode multi-vlan命令,詳細配置請參見“安全配置指導”中的“MAC地址認證”)後,設備直接允許用戶在新的VLAN通過,無需再次認證。
· 對於遷移到其它端口上接入的用戶,如果設備允許MAC遷移,且用戶上線的端口配置了MAC VLAN功能,則建議在MAC遷移的目的端口開啟允許MAC遷移不檢查VLAN功能。
· 當在Trunk類型端口下開啟MAC遷移時不檢查VLAN功能,並對用戶進行802.1X認證時,需要配置端口發送802.1X協議報文不攜帶VLAN Tag功能,詳細介紹請參見“安全配置指導”中的“802.1X”。
表1-13 配置允許MAC遷移功能
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
開啟允許MAC遷移功能 |
port-security mac-move permit [ port | vlan ] |
缺省情況下,允許MAC遷移功能處於關閉狀態 |
開啟允許MAC遷移不檢查VLAN功能 |
port-security mac-move bypass-vlan-check |
缺省情況下,允許MAC遷移不檢查VLAN功能處於關閉狀態 |
M-LAG等組網環境中,當端口安全認證用戶在本端設備下線後從遠端設備重新認證上線時,如果本端設備上的用戶認證MAC表項未老化,則此時通過隧道或peer-link鏈路從遠端設備同步過來的同一認證用戶的MAC表項無法覆蓋原認證MAC表項,導致本端設備上保存的認證用戶的MAC表項異常(MAC地址表記錄的接口與實際上線接口不符),無法正常轉發用戶報文。
配置本功能後,認證MAC從本端設備遷移到遠端設備後,遠端同步過來的認證MAC表項將能夠覆蓋本端設備上未老化的原認證MAC表項,從而保證認證用戶的報文收發正常。
(1) 進入係統視圖。
system-view
(2) 配置MAC遷移後,允許同步的遠端MAC表項覆蓋本端的原MAC表項。
port-security mac-move overwrite-local
缺省情況下,MAC遷移後,允許同步的遠端MAC表項覆蓋本端的原MAC表項。
表1-14 配置許MAC遷移同步的遠端MAC表項覆蓋本端的原MAC表項
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置MAC遷移後,允許同步的遠端MAC表項覆蓋本端的原MAC表項 |
port-security mac-move overwrite-local |
缺省情況下,MAC遷移後,允許同步的遠端MAC表項覆蓋本端的原MAC表項 |
接口上開啟授權失敗用戶下線功能後,當服務器下發的授權信息(目前僅支持ACL、CAR、User Profile)在設備上不存在或者設備下發授權信息失敗時,設備將強製用戶下線。該功能用於配合服務器上的用戶授權控製策略,它僅允許接口上成功下發了授權信息的用戶在線。
對於授權VLAN失敗的情況,設備會直接讓用戶下線,與此功能無關。
開啟本功能時:
· 若不指定任何參數,用戶下線之後,設備再次收到該用戶的報文就對其進行認證處理。
· 若指定quiet-period參數,則表示開啟用戶授權失敗下線靜默功能。用戶下線後,設備將其加入對應認證類型的靜默隊列,並根據對應認證類型的靜默定時器的值來確定用戶認證失敗以後,設備停止對其提供認證服務的時間間隔。在靜默期間,設備不對來自認證失敗用戶的報文進行認證處理,直接丟棄;靜默期後,設備再次收到該用戶的報文,則對其進行認證處理。
若開啟本功能時指定了quiet-period參數則需要先完成如下配置:
· 對於802.1X用戶,通過dot1x quiet-period命令開啟802.1X認證靜默定時器功能,並通過dot1x timer quiet-period命令設置靜默定時器的值。
· 對於MAC地址認證用戶,通過mac-authentication timer quiet命令配置MAC地址認證靜默定時器的值。
表1-15 配置授權失敗用戶下線功能
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
開啟授權失敗用戶下線功能 |
port-security authorization-fail offline [ quiet-period ] |
缺省情況下,授權失敗用戶下線功能處於關閉狀態,即授權失敗後用戶保持在線 |
開啟開放認證模式後,端口上的802.1X、MAC地址認證用戶在接入時即使接入信息不正確(包含不存在的用戶名或者錯誤的密碼兩種情況)也可以正常接入並訪問網絡。在這種模式下接入的用戶被稱為open用戶,此類用戶不授權,不計費,但可通過display dot1x connection open、display mac-authentication connection open命令可以查看用戶信息。當開啟端口安全的開放認證模式後,不影響接入信息正確的用戶正常上線,此類不屬於open用戶。
· 開啟了全局端口安全的開放認證模式後,開放認證模式在所有端口生效;未開啟全局端口安全開放認證模式時,開放認證模式以端口上配置為準。
· 開放認證模式優先級低於802.1X的Auth-Fail VLAN和MAC地址認證的Guest VLAN,即如果端口上配置了802.1X的Auth-Fail VLAN或MAC地址認證的Guest VLAN,密碼錯誤的接入用戶會加入認證失敗VLAN,開放認證模式不生效。有關802.1X、MAC地址認證的詳細介紹,請參見“安全配置指導”中的“802.1X”和“MAC地址認證”。
表1-16 配置開放認證模式
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置全局開放認證模式 |
port-security authentication open global |
缺省情況下,全局端口安全的開放認證模式處於關閉狀態 |
進入接口視圖 |
interface interface-type interface-number |
- |
配置端口開放認證模式 |
port-security authentication open |
缺省情況下,接口端口安全的開放認證模式處於關閉狀態 |
開啟802.1X認證、MAC地址認證或端口安全功能並配置了端口安全模式為userLogin、userLoginSecure、userLoginWithOUI、userLoginSecureExt、macAddressWithRadius、macAddressOrUserLoginSecure、macAddressElseUserLoginSecure、macAddressOrUserLoginSecureExt或macAddressElseUserLoginSecureExt時,若配置了端口安全的Free VLAN功能,則Free VLAN內的流量不需要進行認證,設備直接轉發。
需要注意的是,請不要同時配置端口安全的Free VLAN功能和MAC地址認證請求中攜帶用戶IP地址功能,關於MAC地址認證請求中攜帶用戶IP地址功能的詳細介紹,請參見“安全配置指導”中的“MAC地址認證”。
表1-17 配置端口安全的Free VLAN
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
配置端口安全的Free VLAN |
port-security free-vlan vlan-id-list |
缺省情況下,未配置端口安全的Free VLAN |
用戶的接入VLAN可標識用戶的接入位置,而在某些應用環境中,網絡運營商需要使用接入設備發送給RADIUS服務器的NAS-Identifier屬性值來標識用戶的接入位置,因此接入設備上需要建立用戶接入VLAN與指定的NAS-ID之間的綁定關係。這樣,當用戶上線時,設備會將與用戶接入VLAN匹配的NAS-ID填充在RADIUS請求報文中的NAS-Identifier屬性中發送給RADIUS服務器。
NAS-ID Profile可以在係統視圖下或者接口視圖下進行配置,接口上的配置優先,若接口上沒有配置,則使用係統視圖下的全局配置。
如果指定了NAS-ID Profile,則此Profile中定義的綁定關係優先使用;如果未指定NAS-ID Profile或指定的Profile中沒有找到匹配的綁定關係,則使用設備名作為NAS-ID。
表1-18 配置NAS-ID Profile(係統視圖下)
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
|
創建NAS-ID Profile,並進入NAS-ID-Profile視圖 |
aaa nas-id profile profile-name |
該命令的具體情況請參見“安全命令參考”中的“AAA” |
設置NAS-ID與VLAN的綁定關係 |
nas-id nas-identifier bind vlan vlan-id |
該命令的具體情況請參見“安全命令參考”中的“AAA” |
退回係統視圖 |
quit |
- |
指定引用的NAS-ID Profile |
port-security nas-id-profile profile-name |
缺省情況下,未指定引用的NAS-ID Profile |
表1-19 配置NAS-ID Profile(接口視圖下)
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
|
創建NAS-ID Profile,並進入NAS-ID-Profile視圖 |
aaa nas-id profile profile-name |
該命令的具體情況請參見“安全命令參考”中的“AAA” |
設置NAS-ID與VLAN的綁定關係 |
nas-id nas-identifier bind vlan vlan-id |
該命令的具體情況請參見“安全命令參考”中的“AAA” |
退回係統視圖 |
quit |
- |
進入接口視圖 |
interface interface-type interface-number |
- |
指定引用的NAS-ID Profile |
port-security nas-id-profile profile-name |
缺省情況下,未指定引用的NAS-ID Profile |
端口安全接入用戶流量統計功能是指對在線的802.1X和MAC地址認證用戶的流量進行統計的功能。開啟本功能後,設備會對802.1X和MAC地址認證用戶進行流量統計,並將統計的流量信息發送給計費服務器。未開啟本功能時,設備隻對802.1X和MAC地址認證用戶的在線時長進行統計。如果需要對接入用戶的流量進行計費,可以開啟本功能。
本功能對所有采用802.1X或MAC地址認證機製的接口生效,該接口上可以單獨開啟802.1X或MAC地址認證,也可以使能端口安全並指定相應的認證模式。
當配置了MAC地址認證或者配置了端口接入控製方式為MAC-based的802.1X認證時,設備基於用戶MAC地址統計流量;當配置了端口接入控製方式為Port-based的802.1X認證時,設備基於用戶接入端口統計流量。
本功能僅對新上線的802.1X和MAC地址認證用戶生效,對開啟前已在線的802.1X和MAC地址認證用戶不生效。
統計802.1X和MAC地址認證用戶流量時,需要占用設備的ACL資源。當在線的802.1X和MAC地址認證用戶數量較多的情況下,開啟該功能會占用設備大量ACL資源,可能導致新認證的802.1X和MAC地址認證用戶上線不成功。因此當沒有通過用戶流量進行計費的需求時,建議關閉此功能。
有關802.1X、MAC地址認證的詳細介紹,請參見“安全配置指導”中的“802.1X”和“MAC地址認證”。
表1-20 配置端口安全接入用戶流量統計
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
開啟端口安全用戶流量統計功能 |
port-security traffic-statistics enable |
缺省情況下,端口安全用戶流量統計功能處於關閉狀態 |
開啟端口安全模塊的告警功能後,該模塊會生成告警信息,用於報告該模塊的重要事件。生成的告警信息將發送到設備的SNMP模塊,通過設置SNMP中告警信息的發送參數,來決定告警信息輸出的相關屬性。有關告警信息的詳細介紹,請參見“網絡管理和監控配置指導”中的“SNMP”。
表1-21 配置Trap特性
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
打開指定告警信息的開關 |
snmp-agent trap enable port-security [ address-learned | dot1x-failure | dot1x-logoff | dot1x-logon | intrusion | mac-auth-failure | mac-auth-logoff | mac-auth-logon ] * |
缺省情況下,所有告警信息的開關處於關閉狀態 |
本功能僅在Triple認證環境中生效。Triple認證允許在接入用戶的二層端口上同時開啟Web認證、MAC地址認證和802.1X認證功能,不同類型的終端報文可觸發不同的認證過程,具體介紹請參加“安全配置指導”中的“Triple配置”。配置本功能後,任意終端報文,都將先觸發MAC地址認證。
端口允許多種認證過程同時進行,且某一種認證失敗不會影響同時進行的其它認證過程。一旦終端通過某一種認證,其它認證過程的進行情況有所不同:
· 如果終端通過MAC地址認證仍可以進行802.1X認證,但不會再進行Web認證。如果802.1X認證成功,則端口上生成的802.1X認證用戶信息會覆蓋已存在的MAC地址認證用戶信息。否則,用戶依然保持MAC地址認證在線,且允許再次觸發802.1X認證,但不能再次觸發Web認證。
· 如果MAC地址認證失敗,終端通過了802.1X認證或者Web認證,則端口上其他認證會立即終止,且不能被再次觸發。
配置本功能後,將導致正在認證的用戶認證失敗,用戶需要重新觸發認證才能上線。為了避免造成認證用戶無法上線,請勿隨意配置本功能修改認證方式順序。
表1-22 配置端口的認證順序
操作 |
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
|
進入接口視圖 |
interface interface-type interface-number |
- |
|
配置端口的認證順序為MAC地址認證、802.1X認證和Web認證 |
port-security triple-auth-order mac-dot1x-web |
缺省情況下,Triple認證環境中,不同類型的終端報文最先觸發的認證方式不同 |
認證前域是指,802.1X用戶、MAC地址認證以及Web地址用戶進入認證流程前所處的ISP域。認證前域應用場景包括:
· 首次接入網絡(僅適用於802.1X、Web認證用戶);
· 認證失敗且未配置認證失敗域;
· 服務器不可達但未配置逃生域。
接口上配置了認證前域時,在此接口上接入的認證用戶將被授予指定認證前域內配置的相關授權屬性(目前包括ACL、VLAN和微分段),並根據授權信息獲得相應的網絡訪問權限。若此用戶後續認證成功,則會被AAA下發新的授權信息。
如果當前認證前域中的ACL、VLAN和微分段授權配置發生變化,則新配置僅對新生成的認證前用戶生效,已經存在的用戶繼續使用舊配置。
端口安全認證前域功能與其它認證模塊的逃生功能互斥:
· 端口安全認證前域功能與802.1X認證的Guest VLAN、Auth-fail VLAN、Critical VLAN、Critical微分段以及逃生策略模板互斥。
· 端口安全認證前域功能與MAC地址認證的Guest VLAN、Critical VLAN、Critical微分段以及逃生策略模板互斥。
· 端口安全認證前域功能與Web認證的Auth-fail VLAN互斥。
表1-23 配置端口安全用戶的認證前域
操作 |
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
|
進入接口視圖 |
interface interface-type interface-number |
- |
|
配置端口安全用戶的認證前域 |
port-security pre-auth domain isp-name |
缺省情況下,未配置端口安全用戶的認證前域 |
在用戶認證過程中,當重定向URL指定的Web服務器不可達時,用戶將無法到達指定的Web認證頁麵,從而無法正常上線。配置URL不可達逃生域後,在重定向URL不可達時,用戶可以在逃生域中上線,並訪問其中的資源。
本特性僅適用於MAC地址認證和Web認證用戶。
本功能與802.1X、MAC地址認證和Web認證模塊的Guest VLAN、Auth-fail VLAN、Critical VLAN/微分段以及逃生策略模板功能互斥。
表1-24 配置端口安全用戶重定向URL不可達時的逃生域
操作 |
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
|
進入接口視圖 |
interface interface-type interface-number |
- |
|
配置端口安全用戶重定向URL不可達時的逃生域 |
port-security url-unavailable domain isp-name |
缺省情況下,未指定端口安全用戶認證過程中重定向URL不可達時的逃生域 |
在網絡環境中,對於打印機等啞終端,管理員一般為其分配靜態IP地址。對於這類用戶,為了更加靈活地進行認證,我們可以將其配置為靜態用戶。配置為靜態用戶後,隻要在靜態用戶所連接的接口上使能了802.1X認證、MAC地址認證以及Web認證中的任意一種,設備就能夠使用靜態用戶的IP地址等信息作為用戶名進行認證。
對於不同靜態用戶的上線處理原則:
· 當IP地址不同,MAC地址也不同時,認為是不同靜態用戶,都可以正常認證上線;
· 當MAC相同時,無論IP地址是否相同,已有該MAC用戶在線時不會再觸發認證,IP地址變化時設備可以通過port-security static-user update-ip enable命令更新靜態用戶的IP地址。
· 當IP地址相同,MAC不同時:
¡ 如果該IP地址綁定了MAC地址,則以綁定的MAC地址上線,其餘MAC地址不會再進行認證;
¡ 如果該IP地址沒有綁定MAC地址,隻要IP地址屬於配置的靜態用戶的IP地址,接口都將允許所有不同MAC地址的用戶通過認證上線。
本命令隻對未上線的靜態用戶生效,刪改配置不會影響在線靜態用戶的狀態。
公網或同一私網下,配置靜態用戶的IP地址範圍不能相互重疊。
當靜態用戶使用的用戶名為IP或MAC地址時,設備上不能開啟MAC地址認證自動恢複功能,否則當設備重啟或故障恢複時,靜態用戶會被當作MAC地址認證用戶恢複上線。MAC地址認證自動恢複功能的詳細介紹請參見“安全配置指導”中的“MAC地址認證”。
(1) 進入係統視圖。
system-view
(2) 配置端口接入認證的靜態用戶。
port-security static-user { ip | ipv6 } start-ip-address [ end-ip-address ] [ vpn-instance vpn-instance-name ] [ domain isp-name | [ interface interface-type interface-number [ detect ] ] vlan vlan-id | mac mac-address | keep-online ] *
缺省情況下,未配置端口接入認證的靜態用戶。
(3) (可選)配置靜態用戶上線時使用的用戶名形式。
port-security static-user user-name-format { ip-address | mac-address | system-name }
缺省情況下,靜態用戶的用戶名為接入設備名稱Sysname和用戶IP地址的結合,格式為SysnameIP。
(4) (可選)靜態用戶用戶名為MAC地址時的賬號格式。
port-security static-user user-name-format mac-address { one-section | { six-section | three-section } delimiter { colon | hyphen } } [ uppercase ] [ password-with-mac ]
缺省情況下,靜態用戶的用戶名為接入設備名稱Sysname和用戶IP地址的結合,格式為SysnameIP。
(5) (可選)配置靜態用戶密碼。
port-security static-user password { cipher | simple } string
缺省情況下,未配置靜態用戶密碼。
(6) (可選)配置靜態用戶下線檢測定時器的值。
port-security static-user timer offline-detect time-value
缺省情況下,靜態用戶下線檢測定時器的值為5分鍾。
(7) (可選)配置設備主動發送ARP報文觸發靜態用戶認證的周期。
port-security static-user timer detect-period time-value
缺省情況下,設備主動發送ARP報文觸發靜態用戶認證的周期為3分鍾。
表1-25 配置端口安全用戶的認證前域
操作 |
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
|
配置端口接入認證的靜態用戶 |
port-security static-user { ip | ipv6 } start-ip-address [ end-ip-address ] [ vpn-instance vpn-instance-name ] [ domain isp-name | [ interface interface-type interface-number [ detect ] ] vlan vlan-id | mac mac-address | keep-online ] * |
缺省情況下,未配置端口接入認證的靜態用戶 |
|
(可選)配置靜態用戶上線時使用的用戶名形式 |
port-security static-user user-name-format { ip-address | mac-address | system-name } |
缺省情況下,靜態用戶的用戶名為接入設備名稱Sysname和用戶IP地址的結合,格式為SysnameIP |
|
(可選)靜態用戶用戶名為MAC地址時的賬號格式 |
port-security static-user user-name-format mac-address { one-section | { six-section | three-section } delimiter { colon | hyphen } } [ uppercase ] [ password-with-mac ] |
缺省情況下,靜態用戶的用戶名為接入設備名稱Sysname和用戶IP地址的結合,格式為SysnameIP |
|
(可選)配置靜態用戶密碼 |
port-security static-user password { cipher | simple } string |
缺省情況下,未配置靜態用戶密碼 |
|
(可選)配置靜態用戶下線檢測定時器的值 |
port-security static-user timer offline-detect time-value |
缺省情況下,靜態用戶下線檢測定時器的值為5分鍾 |
|
(可選)配置設備主動發送ARP報文觸發靜態用戶認證的周期 |
port-security static-user timer detect-period time-value |
缺省情況下,設備主動發送ARP報文觸發靜態用戶認證的周期為3分鍾 |
通過port-security static-user命令配置靜態用戶的IP地址範圍後,IP地址處於此範圍內的終端將作為靜態用戶進行認證。終端作為靜態用戶在線後,某些終端可能會向接入認證設備發送異常的ARP報文,這類異常ARP報文的源地址不是靜態用戶的IP地址,觸發設備更新終端的IP地址,更新地址後終端不再是靜態用戶,導致終端下線。
缺省情況下,當收到異常ARP報文時,若源地址非靜態用戶的IP地址,設備不會更新靜態用戶的IP地址,避免導致在線靜態用戶下線。當想要跟蹤終端IP地址的變化情況時,可以選擇開啟本功能,允許設備更新靜態用戶的IP地址。
本功能需要配合DHCP Snooping、ARP Snooping、DHCPv6 Snooping或ND Snooping功能使用,隻有使能相應的Snooping功能,才能收到該Snooping模塊通知的IP地址的變化情況。
表1-26 配置允許設備更新靜態用戶的IP地址
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置允許設備更新靜態用戶的IP地址 |
port-security static-user update-ip enable |
缺省情況下,不允許設備更新靜態用戶的IP地址 |
由於係統資源有限,如果當前端口上接入的用戶過多,接入用戶之間會發生資源的爭用,因此適當地配置該值可以使屬於當前端口的用戶獲得可靠的性能保障。當接入此端口的靜態用戶數達到最大值後,新接入的靜態用戶將被拒絕通過此端口上線。
表1-27 配置端口上最多允許同時接入的靜態用戶數
操作 |
命令 |
說明 |
|
進入係統視圖 |
system-view |
- |
|
進入接口視圖 |
interface interface-type interface-number |
- |
|
配置端口上最多允許同時接入的靜態用戶數 |
port-security static-user max-user max-number |
缺省情況下,端口上最多允許同時接入的靜態用戶數為4294967295 |
配置靜態用戶的IP地址範圍後,匹配上靜態用戶IP的終端能作為靜態用戶認證上線,但在實際使用中存在以下問題:
· 終端發送的第一個報文不可控,當終端首先發送的是不攜帶IP地址的二層報文時,終端無法匹配上靜態用戶的IP,反而會先觸發MAC地址認證。
· 當用戶終端支持IPv4和IPv6雙棧協議時,如果僅配置了靜態用戶的IPv4地址,但終端首先發送的是IPv6報文,則同樣會先觸發MAC地址認證。
為了解決如上問題,可以選擇將MAC地址作為靜態用戶的匹配條件。
配置本功能後,MAC地址匹配上指定ACL規則的用戶將隻允許作為靜態用戶認證上線,不允許觸發其它方式的認證。
本功能中指定的ACL必須是二層ACL,且隻能配置指定源MAC地址範圍的permit類型的規則。
表1-28 配置靜態用戶MAC地址的匹配規則
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置靜態用戶MAC地址的匹配規則 |
port-security static-user match-mac acl acl-number |
缺省情況下,未配置靜態用戶MAC地址的匹配規則 |
端口安全支持配置兩種類型的非認證成功在線用戶定時器:
· 周期性重認證定時器:設備以此間隔為周期對處於指定域內的802.1X認證、MAC地址認證或Web認證在線用戶發起重認證。
· 用戶老化定時器:到達配置的老化時間後,802.1X認證、MAC地址認證或Web認證在線用戶將離開指定的域。
表1-29 配置端口非認證成功在線用戶定時器
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置端口非認證成功在線用戶定時器的值 |
port-security timer { reauth-period { auth-fail-domain | preauth-domain } | user-aging { auth-fail-domain | critical-domain | preauth-domain } } time-value |
缺省情況下,周期性重認證定時器的值為600秒,用戶老化定時器的值為23小時 |
網絡拓撲改變時,STP(Spanning Tree Protocol,生成樹協議)模塊會發送TC(Topology Change,拓撲改變)事件報文通知相關設備網絡拓撲發生變化。
開啟本功能後,當TC隔離組內的網絡拓撲改變,導致成員端口上的在線用戶流量轉發異常時,設備可以根據報文探測結果或TC隔離組成員端口狀態遷移用戶,避免某些用戶無法主動發送用戶報文觸發遷移,同時通過免認證實現遷移用戶的快速重新上線。
本功能實現過程如下:
· 當隔離組的某成員端口處於UP狀態且收到TC事件報文後,設備將查詢從該端口上線的認證用戶,並通過隔離組的另一個成員端口每隔一個探測周期通過另一個成員端口向該成員端口上的在線用戶發送ARP/NS探測報文:
¡ 如果另一個成員端口收到了用戶的回應報文,則該用戶將跳過認證流程,直接遷移到另一個成員端口上線。
¡ 如果另一個成員端口在探測達到最大次數時仍未收到回應報文,則設備認為本隔離組所在網絡拓撲不變,不遷移用戶。
· 當由於隔離組的某成員端口DOWN導致網絡拓撲改變時,設備不會等收到STP模塊發送的TC事件報文,也不會主動從另一個成員端口探測用戶,會立即將用戶從該成員端口免認證遷移到另一個成員端口。遷移後,可通過在新端口上開啟下線檢測或ARP/NS報文探測功能判斷用戶是否能正常上線。
關於TC隔離組的詳細介紹,請參見“二層技術-以太網交換配置指導”中的“生成樹”。
本功能僅對靜態用戶、MAC地址認證用戶和802.1X用戶生效。
建議隔離組兩個成員端口上的所有配置保持一致,否則可能導致用戶遷移失敗。
表1-30 配置允許用戶在隔離組的成員端口間免認證遷移
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
配置允許用戶在隔離組的成員端口間免認證遷移 |
port-security topology-change free-mac-move |
缺省情況下,網絡拓撲改變時,不允許用戶在隔離組的成員端口間免認證遷移 |
配置網絡拓撲改變時,設備主動發送ARP/NS探測報文的周期 |
port-security topology-change detect-period time-value |
缺省情況下,網絡拓撲改變時,設備主動發送ARP/NS探測報文的周期為5秒 |
配置網絡拓撲改變時,設備主動發送ARP/NS探測報文的最大次數 |
port-security topology-change detect-retry retries |
缺省情況下,當網絡拓撲改變時,設備發送探測報文的最大次數為3 |
端口安全接入用戶日誌信息是為了滿足網絡管理員維護的需要,對用戶的接入信息進行記錄。設備生成的端口安全日誌信息會交給信息中心模塊處理,信息中心模塊的配置將決定日誌信息的發送規則和發送方向。關於信息中心的詳細描述請參見“網絡管理和監控配置指導”中的“信息中心”。
為了防止設備輸出過多的端口安全接入用戶日誌信息,一般情況下建議關閉此功能。
表1-31 配置端口安全接入用戶日誌信息功能
操作 |
命令 |
說明 |
進入係統視圖 |
system-view |
- |
開啟端口安全接入用戶日誌信息功能 |
port-security access-user log enable [ failed-authorization | mac-learning | violation | vlan-mac-limit ] * |
缺省情況下,端口安全接入用戶日誌信息功能處於關閉狀態 配置本命令時,如果未指定任何參數,將同時開啟所有參數對應的日誌功能 |
在完成上述配置後,在任意視圖下執行display命令可以顯示配置後端口安全的運行情況,通過查看顯示信息驗證配置的效果。
表1-32 端口安全顯示和維護
操作 |
命令 |
顯示端口安全的配置信息、運行情況和統計信息 |
display port-security [ interface interface-type interface-number ] |
顯示端口接入在線用戶的表項信息 (獨立運行模式) |
display port-security access-user [ m-lag [ local | peer ] ] [ access-type { dot1x | mac-auth | web-auth | static } | domain domain-name | microsegment microsegment-id | online-type { auth-fail-domain | critical-domain | preauth-domain | success } | slot slot-number ] * |
顯示端口接入在線用戶的表項信息 (IRF模式) |
display port-security access-user [ m-lag [ local | peer ] ] [ access-type { dot1x | mac-auth | web-auth | static } | chassis chassis-number slot slot-number | domain domain-name | microsegment microsegment-id | online-type { auth-fail-domain | critical-domain | preauth-domain | success } ] * |
顯示安全MAC地址信息 |
display port-security mac-address security [ interface interface-type interface-number ] [ vlan vlan-id ] [ count ] |
顯示阻塞MAC地址信息 |
display port-security mac-address block [ interface interface-type interface-number ] [ vlan vlan-id ] [ count ] |
顯示端口安全從M-LAG對端同步過來的MAC地址表項信息 |
display port-security mac-address m-lag sync-from-peer [ user-mac mac-address ] |
顯示端口安全M-LAG本端設備同步到對端的MAC地址表項信息 |
display port-security mac-address m-lag sync-to-peer [ interface interface-type interface-number | user-mac mac-address ] |
display port-security static-user |
|
顯示在線靜態用戶的信息 (獨立運行模式) |
display port-security static-user connection [ [ m-lag [ local | peer ] ] [ interface interface-type interface-number | online-type { auth-fail-domain | critical-domain | preauth-domain | success } | slot slot-number | user-name user-name ] | { ip | ipv6 } ip-address | mac mac-address ] |
顯示在線靜態用戶的信息 (IRF模式) |
display port-security static-user connection [ [ m-lag [ local | peer ] ] [ chassis chassis-number slot slot-number | interface interface-type interface-number | online-type { auth-fail-domain | critical-domain | preauth-domain | success } | user-name user-name ] | { ip | ipv6 } ip-address | mac mac-address ] |
顯示端口安全的統計計數信息 (獨立運行模式) |
display port-security statistics [ slot slot-number ] |
顯示端口安全的統計計數信息 (IRF模式) |
display port-security statistics [ chassis chassis-number slot slot-number ] |
強製在線靜態用戶下線 |
reset port-security static-user [ interface interface-type interface-number | { ip | ipv6 } ip-address | mac mac-address | online-type { auth-fail-domain | critical-domain | preauth-domain | success } | user-name user-name ] |
清除端口安全的統計計數信息 |
reset port-security statistics |
在Device的端口GigabitEthernet1/0/1上對接入用戶做如下的限製:
· 允許64個用戶自由接入,不進行認證,將學習到的用戶MAC地址添加為Sticky MAC地址,老化時間為30分鍾;
· 當安全MAC地址數量達到64後,停止學習;當再有新的MAC地址接入時,觸發入侵檢測,並將此端口關閉30秒。
圖1-2 端口安全autoLearn模式組網圖
# 使能端口安全。
<Device> system-view
[Device] port-security enable
# 設置安全MAC地址的老化時間為30分鍾。
[Device] port-security timer autolearn aging 30
# 設置端口安全允許的最大安全MAC地址數為64。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port-security max-mac-count 64
# 設置端口安全模式為autoLearn。
[Device-GigabitEthernet1/0/1] port-security port-mode autolearn
# 設置觸發入侵檢測特性後的保護動作為暫時關閉端口,關閉時間為30秒。
[Device-GigabitEthernet1/0/1] port-security intrusion-mode disableport-temporarily
[Device-GigabitEthernet1/0/1] quit
[Device] port-security timer disableport 30
上述配置完成後,可以使用如下顯示命令查看端口安全的配置情況。
[Device] display port-security interface gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
M-LAG load sharing mode (criterion) : Distributed (local)
M-LAG member's authentication scope : Local M-LAG interfaces
M-LAG member configuration conflict : Unknown
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
Traffic-statistics : Disabled
User aging period for preauth domain : 82800 sec
User aging period for Auth-Fail domain : 82800 sec
User aging period for critical domain : 82800 sec
Reauth period for preauth domain : 600 sec
Reauth period for Auth-Fail domain : 600 sec
MAC move for topology change protection : Denied
Topology change detection period : 5 sec
Max detection attempts : 3
OUI value list :
Index : 1 Value : 123401
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 : 0
Authorization : Permitted
NAS-ID profile : Not configured
可以看到端口安全所允許的最大安全MAC地址數為64,端口模式為autoLearn,入侵檢測保護動作為DisablePortTemporarily,入侵發生後端口被禁用時間為30秒。
配置生效後,端口允許地址學習,學習到的MAC地址數可在上述顯示信息的“Current number of secure MAC addresses”字段查看到,具體的MAC地址信息可以在接口視圖下用display this命令查看。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] display this
#
interface GigabitEthernet1/0/1
port-security max-mac-count 64
port-security port-mode autolearn
port-security mac-address security sticky 0002-0000-0015 vlan 1
port-security mac-address security sticky 0002-0000-0014 vlan 1
port-security mac-address security sticky 0002-0000-0013 vlan 1
port-security mac-address security sticky 0002-0000-0012 vlan 1
port-security mac-address security sticky 0002-0000-0011 vlan 1
#
當學習到的MAC地址數達到64後,用命令display port-security interface可以看到端口模式變為secure,再有新的MAC地址到達將觸發入侵保護,可以通過命令display interface看到此端口關閉。30秒後,端口狀態恢複。此時,如果手動刪除幾條安全MAC地址後,端口安全的狀態重新恢複為autoLearn,可以繼續學習MAC地址。
客戶端通過端口GigabitEthernet1/0/1連接到Device上,Device通過RADIUS服務器對客戶端進行身份認證,如果認證成功,客戶端被授權允許訪問Internet資源。
· IP地址為192.168.1.2的RADIUS服務器作為主認證服務器和從計費服務器,IP地址為192.168.1.3的RADIUS服務器作為從認證服務器和主計費服務器。認證共享密鑰為name,計費共享密鑰為money。
· 所有接入用戶都使用ISP域sun的認證/授權/計費方法,該域最多可同時接入30個用戶;
· 係統向RADIUS服務器重發報文的時間間隔為5秒,重發次數為5次,發送實時計費報文的時間間隔為15分鍾,發送的用戶名不帶域名。
· 端口GigabitEthernet1/0/1同時允許一個802.1X用戶以及一個與指定OUI值匹配的設備接入。
圖1-3 端口安全userLoginWithOUI模式組網圖
· 下述配置步驟包含了部分AAA/RADIUS協議配置命令,具體介紹請參見“安全配置指導”中的“AAA”。
· 保證客戶端和RADIUS服務器之間路由可達。
(1) 配置AAA
# 配置RADIUS方案。
<Device> system-view
[Device] radius scheme radsun
[Device-radius-radsun] primary authentication 192.168.1.2
[Device-radius-radsun] primary accounting 192.168.1.3
[Device-radius-radsun] secondary authentication 192.168.1.3
[Device-radius-radsun] secondary accounting 192.168.1.2
[Device-radius-radsun] key authentication simple name
[Device-radius-radsun] key accounting simple money
[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域。
[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
(2) 配置802.1X
# 配置802.1X的認證方式為CHAP。(該配置可選,缺省情況下802.1X的認證方式為CHAP)
[Device] dot1x authentication-method chap
# 指定端口上接入的802.1X用戶使用強製認證域sun。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] dot1x mandatory-domain sun
[Device-GigabitEthernet1/0/1] quit
(3) 配置端口安全
# 使能端口安全。
[Device] port-security enable
# 添加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 gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port-security port-mode userlogin-withoui
[Device-GigabitEthernet1/0/1] quit
# 查看端口安全的配置信息。
[Device] display port-security interface gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
M-LAG load sharing mode (criterion) : Distributed (local)
M-LAG member's authentication scope : Local M-LAG interfaces
M-LAG member configuration conflict : Unknown
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
Traffic-statistics : Disabled
User aging period for preauth domain : 82800 sec
User aging period for Auth-Fail domain : 82800 sec
User aging period for critical domain : 82800 sec
Reauth period for preauth domain : 600 sec
Reauth period for Auth-Fail domain : 600 sec
MAC move for topology change protection : Denied
Topology change detection period : 5 sec
Max detection attempts : 3
OUI value list :
Index : 1 Value : 123401
Index : 2 Value : 123402
Index : 3 Value : 123403
Index : 4 Value : 123404
Index : 5 Value : 123405
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 : 1
Authorization :Permitted
NAS-ID profile : Not configured
配置完成後,如果有802.1X用戶上線,則可以通過上述顯示信息看到當前端口保存的MAC地址數為1。還可以通過display dot1x命令查看該802.1X用戶的在線情況。
此外,端口還允許一個MAC地址與OUI值匹配的用戶通過,可以通過下述命令查看。
[Device] display mac-address interface gigabitethernet 1/0/1
MAC Address VLAN ID State Port/Nickname Aging
1234-0300-0011 1 Learned GE1/0/1 Y
客戶端通過端口GigabitEthernet1/0/1連接到Device上,Device通過RADIUS服務器對客戶端進行身份認證。如果認證成功,客戶端被授權允許訪問Internet資源。
· 可以有多個MAC認證用戶接入;
· 如果是802.1X用戶請求認證,先進行MAC地址認證,MAC地址認證失敗,再進行802.1X認證。最多隻允許一個802.1X用戶接入;
· MAC地址認證設置用戶名格式為用戶MAC地址的形式;
· 上線的MAC地址認證用戶和802.1X認證用戶總和不能超過64個;
· 為防止報文發往未知目的MAC地址,啟動ntkonly方式的Need To Know特性。
圖1-4 端口安全macAddressElseUserLoginSecure模式組網圖
· RADIUS認證/計費及ISP域的配置同“1.28.2 端口安全userLoginWithOUI模式配置舉例”,這裏不再贅述。
· 保證接入用戶和RADIUS服務器之間路由可達。
# 使能端口安全。
<Device> system-view
[Device] port-security enable
# 配置MAC認證的用戶名和密碼,使用帶連字符“-”的MAC地址格式,其中字母大寫。
[Device] mac-authentication user-name-format mac-address with-hyphen uppercase
# 配置MAC地址認證用戶所使用的ISP域。
[Device] mac-authentication domain sun
# 配置802.1X的認證方式為CHAP。(該配置可選,缺省情況下802.1X的認證方式為CHAP)
[Device] dot1x authentication-method chap
# 設置端口安全允許的最大MAC地址數為64。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port-security max-mac-count 64
# 設置端口安全模式為macAddressElseUserLoginSecure。
[Device-GigabitEthernet1/0/1] port-security port-mode mac-else-userlogin-secure
# 指定端口上接入的802.1X用戶使用強製認證域sun。
[Device-GigabitEthernet1/0/1] dot1x mandatory-domain sun
[Device-GigabitEthernet1/0/1] quit
# 設置端口Need To Know模式為ntkonly。
[Device-GigabitEthernet1/0/1] port-security ntk-mode ntkonly
[Device-GigabitEthernet1/0/1] quit
# 查看端口安全的配置信息。
[Device] display port-security interface gigabitethernet 1/0/1
Global port security parameters:
Port security : Enabled
M-LAG load sharing mode (criterion) : Distributed (local)
M-LAG member's authentication scope : Local M-LAG interfaces
M-LAG member configuration conflict : Unknown
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
Traffic-statistics : Disabled
User aging period for preauth domain : 82800 sec
User aging period for Auth-Fail domain : 82800 sec
User aging period for critical domain : 82800 sec
Reauth period for preauth domain : 600 sec
Reauth period for Auth-Fail domain : 600 sec
MAC move for topology change protection : Denied
Topology change detection period : 5 sec
Max detection attempts : 3
OUI value list
GigabitEthernet1/0/1 is link-up
Port mode : macAddressElseUserLoginSecure
NeedToKnow mode : NeedToKnowOnly
Intrusion protection mode : NoAction
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
配置完成後,如果有用戶認證上線,則可以通過下述顯示信息看到當前端口上的用戶認證信息。
# 查看MAC地址認證信息。
[Device] display mac-authentication interface gigabitethernet 1/0/1
Global MAC authentication parameters:
MAC authenticaiton : Enabled
Authentication method : PAP
M-LAG member configuration conflict : Unknown
User name format : MAC address in uppercase(XX-XX-XX-XX-XX-XX)
Username : mac
Password : Not configured
MAC range accounts : 0
MAC address Mask Username
Offline detect period : 300 s
Quiet period : 180 s
Server timeout : 100 s
Reauth period : 3600 s
User aging period for critical VLAN : 1000 s
User aging period for critical VSI : 400 s
User aging period for guest VLAN : 1000 s
User aging period for guest VSI : 1000 s
User aging period for critical microsegment: 1000 s
Temporary user aging period : 60 s
Authentication domain : sun
HTTP proxy port list : Not configured
HTTPS proxy port list : Not configured
Online MAC-auth wired users : 3
Silent MAC users:
MAC address VLAN ID From port Port index
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 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
Max online users : 256
Authentication attempts : successful 3, failed 7
Current online users : 0
MAC address Auth state
1234-0300-0011 Authenticated
1234-0300-0012 Authenticated
1234-0300-0013 Authenticated
# 查看802.1X認證信息。
[Device] display dot1x interface gigabitethernet 1/0/1
Global 802.1X parameters:
802.1X authentication : Enabled
M-LAG member configuration conflict : Unknown
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
Unicast-trigger quiet period : 0 s
Max auth requests : 2
SmartOn switch ID : 30
SmartOn supp timeout : 30 s
SmartOn retry counts : 3
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
Permit authentication-escape : Disabled
EAD timeout : 30 min
Domain delimiter : @
Max-user-alarm trigger threshold : 100%
Max-user-alarm clear threshold : 50%
Online 802.1X wired users : 1
GigabitEthernet1/0/1 is link-up
802.1X authenticaiton : Enabled
Handshake : Enabled
Handshake reply : Disabled
Handshake security : Disabled
Unicast trigger : Disabled
Periodic reauth : Disabled
Port role : Authenticator
Authorization mode : Auto
Port access control : MAC-based
Multicast trigger : Enabled
Mandatory auth domain : sun
Guest VLAN : Not configured
Auth-Fail VLAN : Not configured
Critical VLAN : Not configured
Re-auth server-unreachable : Logoff
Max online users : 4294967295
Max online preauth-domain users : 4294967295
Max online Auth-Fail-domain users: 4294967295
SmartOn : Disabled
Add Guest VLAN delay : Disabled
Guest VSI : Not configured
Auth-Fail VSI : Not configured
Critical VSI : Not configured
Critical microsegment ID :Not configured
Critical profile : Not configured
User aging : Enabled
Server-recovery online-user-sync : Enabled
EAPOL packets: Tx 16331, Rx 102
Sent EAP Request/Identity packets : 16316
EAP Request/Challenge packets: 6
EAP Success packets: 4
EAP Failure packets: 5
Received EAPOL Start packets : 6
EAPOL LogOff packets: 2
EAP Response/Identity packets : 80
EAP Response/Challenge packets: 6
Error packets: 0
Online 802.1X users: 1
MAC address Auth state
0002-0000-0011 Authenticated
此外,因為設置了Need To Know特性,目的MAC地址未知、廣播和多播報文都被丟棄。
客戶端經過Device A和Device B接入網絡,由Device A和Device B對用戶進行身份認證,具體需求如下:
· 采用RADIUS服務器對用戶進行認證/授權/計費。
· Device A和Device B組成M-LAG係統,正常工作時鏈路進行負載分擔且任何一台設備故障對業務均沒有影響,保證用戶業務的高可靠性。
· Device A和Device B的M-LAG接口上對用戶采用macAddressWithRadius認證模式,且對用戶報文進行負載分擔,負載分擔的模式為本端M-LAG接口上送的用戶報文在本端M-LAG設備處理。
· M-LAG係統中的一台M-LAG設備發生故障時,要求該故障設備上的用戶發送的RADIUS報文的源IP始終保持不變,且使用M-LAG虛擬IP地址。
圖1-5 端口安全支持M-LAG典型配置組網圖
設備 |
接口 |
M-LAG接口 |
IP地址 |
Device A(M-LAG1) |
GE1/0/1 |
Keepalive鏈路接口 |
1.1.1.2/24 |
BAGG1(GE1/0/2) |
peer-link口 |
- |
|
BAGG2(GE1/0/4) |
M-LAG接口 |
- |
|
BAGG3(GE1/0/3) |
M-LAG接口 |
- |
|
Vlan-int 2 |
- |
10.1.1.1/24 |
|
Device B(M-LAG2) |
GE1/0/1 |
Keepalive鏈路接口 |
1.1.1.1/24 |
BAGG1(GE1/0/2) |
peer-link口 |
- |
|
BAGG2(GE1/0/4) |
M-LAG接口 |
- |
|
BAGG3(GE1/0/3) |
M-LAG接口 |
- |
|
Vlan-int 2 |
- |
- |
下述配置步驟包含了部分AAA/RADIUS協議配置命令,具體介紹請參見“安全配置指導”中的“AAA”。
下述配置步驟包含了部分M-LAG配置命令,具體介紹請參見“二層技術-以太網交換配置指導”中的“M-LAG”。
保證接入用戶和RADIUS服務器之間路由可達。
配置RADIUS服務器,添加用戶賬戶,保證用戶的認證/授權/計費功能正常運行。
(1) 配置DeviceA
¡ 配置AAA。
# 配置RADIUS方案。
<DeviceA> system-view
[DeviceA] radius scheme radsun
[DeviceA-radius-radsun] primary authentication 10.1.1.3
[DeviceA-radius-radsun] primary accounting 10.1.1.4
[DeviceA-radius-radsun] secondary authentication 10.1.1.4
[DeviceA-radius-radsun] secondary accounting 10.1.1.3
[DeviceA-radius-radsun] key authentication simple name
[DeviceA-radius-radsun] key accounting simple money
[DeviceA-radius-radsun] timer response-timeout 5
[DeviceA-radius-radsun] retry 5
[DeviceA-radius-radsun] timer realtime-accounting 15
[DeviceA-radius-radsun] user-name-format without-domain
# 配置本端M-LAG接口接入的用戶發送RADIUS報文使用的源IP地址為10.1.1.1,對端M-LAG接口接入的用戶發送RADIUS報文使用的源IP地址為10.1.1.2。
[DeviceA-radius-radsun] nas-ip m-lag local 10.1.1.1
[DeviceA-radius-radsun] nas-ip m-lag peer 10.1.1.2
[DeviceA-radius-radsun] quit
# 配置ISP域。
[DeviceA] domain sun
[DeviceA-isp-sun] authentication lan-access radius-scheme radsun
[DeviceA-isp-sun] authorization lan-access radius-scheme radsun
[DeviceA-isp-sun] accounting lan-access radius-scheme radsun
[DeviceA-isp-sun] quit
¡ 配置M-LAG。
# 係統配置。
[DeviceA] m-lag system-mac 1-1-1
[DeviceA] m-lag system-number 1
[DeviceA] m-lag system-priority 123
# 配置Keepalive報文的目的IP地址和源IP地址。
[DeviceA] m-lag keepalive ip destination 1.1.1.1 source 1.1.1.2
# 配置端口GigabitEthernet1/0/5工作在三層模式,並配置IP地址為Keepalive報文的源IP地址。
[DeviceA] interface gigabitethernet 1/0/5
[DeviceA-GigabitEthernet1/0/5] port link-mode route
[DeviceA-GigabitEthernet1/0/5] ip address 1.1.1.2 24
[DeviceA-GigabitEthernet1/0/5] quit
# 配置Keepalive鏈路接口為保留接口。
[DeviceA] m-lag mad exclude interface gigabitethernet 1/0/5
# 創建二層聚合接口1,並配置該接口為動態聚合模式。
[DeviceA] interface bridge-aggregation 1
[DeviceA-Bridge-Aggregation1] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation1] quit
# 將端口GigabitEthernet1/0/2加入到聚合組1中。
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port link-aggregation group 1
[DeviceA-GigabitEthernet1/0/2] quit
# 將二層聚合接口1配置為peer-link口。
[DeviceA] interface bridge-aggregation 1
[DeviceA-Bridge-Aggregation1] port m-lag peer-link 1
[DeviceA-Bridge-Aggregation1] quit
# 創建VLAN接口2,並配置該接口下的處於可用狀態的M-LAG虛擬IP地址10.1.1.1以及處於不可用狀態的M-LAG虛擬IP地址10.1.1.2。
[DeviceA] vlan 2
[DeviceA-vlan2] quit
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] port m-lag virtual-ip 10.1.1.1 24 active virtual-mac 11-1-1
[DeviceA-Vlan-interface2] port m-lag virtual-ip 10.1.1.2 24 standby virtual-mac 11-1-2
[DeviceA-Vlan-interface2] quit
# 創建二層聚合接口2,並配置該接口為動態聚合模式。
[DeviceA] interface bridge-aggregation 2
[DeviceA-Bridge-Aggregation2] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation2] quit
# 將端口GigabitEthernet1/0/4加入到聚合組2中。
[DeviceA] interface gigabitethernet 1/0/4
[DeviceA-GigabitEthernet1/0/4] port link-aggregation group 2
[DeviceA-GigabitEthernet1/0/4] quit
# 將二層聚合接口2加入跨設備鏈路聚合組2中。
[DeviceA] interface bridge-aggregation 2
[DeviceA-Bridge-Aggregation2] port m-lag group 2
[DeviceA-Bridge-Aggregation2] port access vlan 2
[DeviceA-Bridge-Aggregation2] quit
# 創建二層聚合接口3,並配置該接口為動態聚合模式。
[DeviceA] interface bridge-aggregation 3
[DeviceA-Bridge-Aggregation3] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation3] quit
# 將端口GigabitEthernet1/0/3加入到聚合組3中。
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port link-aggregation group 3
[DeviceA-GigabitEthernet1/0/3] quit
# 將二層聚合接口3加入跨設備鏈路聚合組3中。
[DeviceA] interface bridge-aggregation 3
[DeviceA-Bridge-Aggregation3] port m-lag group 3
[DeviceA-Bridge-Aggregation3] quit
¡ 配置端口安全。
# 使能端口安全。
[DeviceA] port-security enable
# 配置MAC認證的用戶名和密碼,使用帶連字符“-”的MAC地址格式,其中字母大寫。
[DeviceA] mac-authentication user-name-format mac-address with-hyphen uppercase
# 配置MAC地址認證用戶所使用的ISP域。
[DeviceA] mac-authentication domain sun
# 在二層聚合接口3上設置端口安全模式為macAddressWithRadius。
[DeviceA] interface bridge-aggregation 3
[DeviceA-Bridge-Aggregation3] port-security port-mode mac-authentication
# 指定端口上接入的MAC地址認證用戶使用強製認證域sun。
[DeviceA-Bridge-Aggregation3] mac-authentication domain sun
[DeviceA-Bridge-Aggregation3] quit
(2) 配置Device B
¡ 配置AAA。
# 配置RADIUS方案。
<DeviceB> system-view
[DeviceB] radius scheme radsun
[DeviceB-radius-radsun] primary authentication 10.1.1.3
[DeviceB-radius-radsun] primary accounting 10.1.1.4
[DeviceB-radius-radsun] secondary authentication 10.1.1.4
[DeviceB-radius-radsun] secondary accounting 10.1.1.3
[DeviceB-radius-radsun] key authentication simple name
[DeviceB-radius-radsun] key accounting simple money
[DeviceB-radius-radsun] timer response-timeout 5
[DeviceB-radius-radsun] retry 5
[DeviceB-radius-radsun] timer realtime-accounting 15
[DeviceB-radius-radsun] user-name-format without-domain
# 配置本端M-LAG接口接入的用戶發送RADIUS報文使用的源IP地址為10.1.1.2,對端M-LAG接口接入的用戶發送RADIUS報文使用的源IP地址為10.1.1.1。
[DeviceB-radius-radsun] nas-ip m-lag local 10.1.1.2
[DeviceB-radius-radsun] nas-ip m-lag peer 10.1.1.1
[DeviceB-radius-radsun] quit
# 配置ISP域。
[DeviceB] domain sun
[DeviceB-isp-sun] authentication lan-access radius-scheme radsun
[DeviceB-isp-sun] authorization lan-access radius-scheme radsun
[DeviceB-isp-sun] accounting lan-access radius-scheme radsun
[DeviceB-isp-sun] quit
¡ 配置M-LAG。
# 係統配置。
[DeviceB] m-lag system-mac 1-1-1
[DeviceB] m-lag system-number 2
[DeviceB] m-lag system-priority 123
# 配置Keepalive報文的目的IP地址和源IP地址。
[DeviceB] m-lag keepalive ip destination 1.1.1.2 source 1.1.1.1
# 配置端口GigabitEthernet1/0/5工作在三層模式,並配置IP地址為Keepalive報文的源IP地址。
[DeviceB] interface gigabitethernet 1/0/5
[DeviceB-GigabitEthernet1/0/5] port link-mode route
[DeviceB-GigabitEthernet1/0/5] ip address 1.1.1.1 24
[DeviceB-GigabitEthernet1/0/5] quit
# 配置Keepalive鏈路接口為保留接口。
[DeviceB] m-lag mad exclude interface gigabitethernet 1/0/5
# 創建二層聚合接口1,並配置該接口為動態聚合模式。
[DeviceB] interface bridge-aggregation 1
[DeviceB-Bridge-Aggregation1] link-aggregation mode dynamic
[DeviceB-Bridge-Aggregation1] quit
# 將端口GigabitEthernet1/0/2加入到聚合組1中。
[DeviceB] interface gigabitethernet 1/0/2
[DeviceB-GigabitEthernet1/0/2] port link-aggregation group 1
[DeviceB-GigabitEthernet1/0/2] quit
# 將二層聚合接口1配置為peer-link口。
[DeviceB] interface bridge-aggregation 1
[DeviceB-Bridge-Aggregation1] port m-lag peer-link 1
[DeviceB-Bridge-Aggregation1] quit
# 創建VLAN接口2,並配置該接口下的處於可用狀態的M-LAG虛擬IP地址10.1.1.2以及處於不可用狀態的M-LAG虛擬IP地址10.1.1.1。
[DeviceB] vlan 2
[DeviceB-vlan2] quit
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] port m-lag virtual-ip 10.1.1.2 24 active virtual-mac 11-1-2
[DeviceB-Vlan-interface2] port m-lag virtual-ip 10.1.1.1 24 standby virtual-mac 11-1-1
[DeviceB-Vlan-interface2] quit
# 創建二層聚合接口2,並配置該接口為動態聚合模式。
[DeviceB] interface bridge-aggregation 2
[DeviceB-Bridge-Aggregation2] link-aggregation mode dynamic
[DeviceB-Bridge-Aggregation2] quit
# 將端口GigabitEthernet1/0/4加入到聚合組2中。
[DeviceB] interface gigabitethernet 1/0/4
[DeviceB-GigabitEthernet1/0/4] port link-aggregation group 2
[DeviceB-GigabitEthernet1/0/4] quit
# 將二層聚合接口2加入跨設備鏈路聚合組2中。
[DeviceB] interface bridge-aggregation 2
[DeviceB-Bridge-Aggregation2] port m-lag group 2
[DeviceB-Bridge-Aggregation2] port access vlan 2
[DeviceB-Bridge-Aggregation2] quit
# 創建二層聚合接口3,並配置該接口為動態聚合模式。
[DeviceB] interface bridge-aggregation 3
[DeviceB-Bridge-Aggregation3] link-aggregation mode dynamic
[DeviceB-Bridge-Aggregation3] quit
# 將端口GigabitEthernet1/0/3加入到聚合組3中。
[DeviceB] interface gigabitethernet 1/0/3
[DeviceB-GigabitEthernet1/0/3] port link-aggregation group 3
[DeviceB-GigabitEthernet1/0/3] quit
# 將二層聚合接口3加入跨設備鏈路聚合組3中。
[DeviceB] interface bridge-aggregation 3
[DeviceB-Bridge-Aggregation3] port m-lag group 3
[DeviceB-Bridge-Aggregation3] quit
¡ 配置端口安全。
# 使能端口安全。
[DeviceB] port-security enable
# 配置MAC認證的用戶名和密碼,使用帶連字符“-”的MAC地址格式,其中字母大寫。
[DeviceB] mac-authentication user-name-format mac-address with-hyphen uppercase
# 配置MAC地址認證用戶所使用的ISP域。
[DeviceB] mac-authentication domain sun
# 在二層聚合接口3上設置端口安全模式為macAddressWithRadius。
[DeviceB] interface bridge-aggregation 3
[DeviceB-Bridge-Aggregation3] port-security port-mode mac-authentication
# 指定端口上接入的MAC地址用戶使用強製認證域sun。
[DeviceB-Bridge-Aggregation3] mac-authentication domain sun
[DeviceB-Bridge-Aggregation3] quit
(3) 配置Device C
# 創建二層聚合接口1,並配置該接口為動態聚合模式。
<DeviceC> system-view
[DeviceC] interface bridge-aggregation 1
[DeviceC-Bridge-Aggregation1] link-aggregation mode dynamic
[DeviceC-Bridge-Aggregation1] quit
# 分別將端口GigabitEthernet1/0/1和GigabitEthernet1/0/4加入到聚合組1中。
[DeviceC] interface range gigabitethernet 1/0/1 to gigabitethernet 1/0/4
[DeviceC-if-range] port link-aggregation group 1
[DeviceC-if-range] quit
(4) 配置Device D
# 創建二層聚合接口1,並配置該接口為動態聚合模式。
<DeviceD> system-view
[DeviceD] interface bridge-aggregation 1
[DeviceD-Bridge-Aggregation1] link-aggregation mode dynamic
[DeviceD-Bridge-Aggregation1] quit
# 分別將端口GigabitEthernet1/0/1和GigabitEthernet1/0/4加入到聚合組1中。
[DeviceD] interface range gigabitethernet 1/0/1 to gigabitethernet 1/0/4
[DeviceD-if-range] port link-aggregation group 1
[DeviceD-if-range] quit
(1) 驗證Device A
# 查看Device A上的M-LAG簡要信息。
[DeviceA] display m-lag summary
Flags: A -- Aggregate interface down, B -- No peer M-LAG interface configured
C -- Configuration consistency check failed
Peer-link interface: BAGG1
Peer-link interface state (cause): UP
Keepalive link state (cause): UP
M-LAG interface information
M-LAG interface M-LAG group Local state (cause) Peer state Remaining down time(s)
BAGG2 2 UP UP -
BAGG3 3 UP UP -
以上信息表明Device A和Device B成功組成跨設備鏈路聚合係統。
# 查看Device A上的端口安全配置信息。
[DeviceA] display port-security interface bridge-aggregation 3
Global port security parameters:
Port security : Enabled
M-LAG load sharing mode (criterion) : Distributed (local)
M-LAG member's authentication scope : Local M-LAG interfaces
M-LAG member configuration conflict : Not conflicted
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
Traffic-statistics : Enabled
User aging period for preauth domain : 82800 sec
User aging period for Auth-Fail domain : 82800 sec
User aging period for critical domain : 82800 sec
Reauth period for preauth domain : 600 sec
Reauth period for Auth-Fail domain : 600 sec
MAC move for topology change protection : Denied
Topology change detection period : 5 sec
Max detection attempts : 3
OUI value list :
Bridge-Aggregation3 is link-up
Port mode : macAuthentication
NeedToKnow mode : Disabled
Intrusion protection mode : NoAction
Max secure MAC addresses : Not configured
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
配置完成後,如果有用戶認證上線,則可以通過下述顯示信息看到當前端口上的用戶認證信息。
# 查看Device A上的MAC地址認證信息。
[DeviceA] display mac-authentication interface bridge-aggregation 3
Global MAC authentication parameters:
MAC authentication : Enabled
Authentication method : CHAP
M-LAG member configuration conflict : Not conflicted
Username format : MAC address in lowercase(xxxxxxxxxxxx)
Username : mac
Password : Not configured
MAC range accounts : 0
MAC address Mask Username
Offline detect period : 60 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
User aging period for critical microsegment: 1000 s
Authentication domain : test
HTTP proxy port list : Not configured
HTTPS proxy port list : Not configured
Max number of silent MACs : 1024 (per slot)
Online MAC-auth wired users : 10
Silent MAC users:
MAC address VLAN ID From port Port index
Bridge-Aggregation3 is link-up
MAC authentication : Enabled
Carry User-IP : Disabled
Authentication domain : test
Auth-delay timer : Disabled
Periodic reauth : Disabled
Re-auth server-unreachable : Logoff
Guest VLAN : Not configured
Guest VLAN reauthentication : Enabled
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 : Disabled
Guest VSI : Not configured
Guest VSI reauthentication : Enabled
Guest VSI auth-period : 30 s
Critical VSI : Not configured
Critical microsegment ID : Not configured
URL user logoff : No
Auto-tag feature : Disabled
VLAN tag configuration ignoring : Disabled
Max online users : 4294967295
Authentication attempts : successful 6, failed 3174
Current online users : 10
MAC address Auth state
0000-0000-0001 Authenticated
0000-0000-0002 Authenticated
0000-0000-0003 Authenticated
0000-0000-0004 Authenticated
0000-0000-0005 Authenticated
0000-0000-0006 Authenticated
0000-0000-0007 Authenticated
0000-0000-0008 Authenticated
0000-0000-0009 Authenticated
0000-0000-000a Authenticated
(2) 驗證Device B
# 查看DeviceB上的M-LAG簡要信息。
[DeviceB] display m-lag summary
Flags: A -- Aggregate interface down, B -- No peer M-LAG interface configured
C -- Configuration consistency check failed
Peer-link interface: BAGG1
Peer-link interface state (cause): UP
Keepalive link state (cause): UP
M-LAG interface information
M-LAG interface M-LAG group Local state (cause) Peer state Remaining down time(s)
BAGG2 2 UP UP -
BAGG3 3 UP UP -
以上信息表明Device A和Device B成功組成跨設備鏈路聚合係統。
# 查看Device B上端口安全的配置信息。
[DeviceB]display port-security interface bridge-aggregation 3
Global port security parameters:
Port security : Enabled
M-LAG load sharing mode (criterion) : Distributed (local)
M-LAG member's authentication scope : Local M-LAG interfaces
M-LAG member configuration conflict : Not conflicted
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
Traffic-statistics : Enabled
User aging period for preauth domain : 82800 sec
User aging period for Auth-Fail domain : 82800 sec
User aging period for critical domain : 82800 sec
Reauth period for preauth domain : 600 sec
Reauth period for Auth-Fail domain : 600 sec
MAC move for topology change protection : Denied
Topology change detection period : 5 sec
Max detection attempts : 3
OUI value list :
Bridge-Aggregation3 is link-up
Port mode : macAuthentication
NeedToKnow mode : Disabled
Intrusion protection mode : NoAction
Max secure MAC addresses : Not configured
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
配置完成後,如果有用戶認證上線,則可以通過下述顯示信息看到當前端口上的用戶認證信息。
# 查看Device B上的MAC地址認證信息。
[DeviceB] display mac-authentication interface bridge-aggregation 3
Global MAC authentication parameters:
MAC authentication : Enabled
Authentication method : CHAP
M-LAG member configuration conflict : Not conflicted
Username format : MAC address in lowercase(xxxxxxxxxxxx)
Username : mac
Password : Not configured
MAC range accounts : 0
MAC address Mask Username
Offline detect period : 60 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
User aging period for critical microsegment: 1000 s
Authentication domain : test
HTTP proxy port list : Not configured
HTTPS proxy port list : Not configured
Max number of silent MACs : 1024 (per slot)
Online MAC-auth wired users : 10
Silent MAC users:
MAC address VLAN ID From port Port index
Bridge-Aggregation3 is link-up
MAC authentication : Enabled
Carry User-IP : Disabled
Authentication domain : test
Auth-delay timer : Disabled
Periodic reauth : Disabled
Re-auth server-unreachable : Logoff
Guest VLAN : Not configured
Guest VLAN reauthentication : Enabled
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 : Disabled
Guest VSI : Not configured
Guest VSI reauthentication : Enabled
Guest VSI auth-period : 30 s
Critical VSI : Not configured
Critical microsegment ID : Not configured
URL user logoff : No
Auto-tag feature : Disabled
VLAN tag configuration ignoring : Disabled
Max online users : 4294967295
Authentication attempts : successful 20, failed 3099
Current online users : 10
MAC address Auth state
0000-0000-0001 Authenticated
0000-0000-0002 Authenticated
0000-0000-0003 Authenticated
0000-0000-0004 Authenticated
0000-0000-0005 Authenticated
0000-0000-0006 Authenticated
0000-0000-0007 Authenticated
0000-0000-0008 Authenticated
0000-0000-0009 Authenticated
0000-0000-000a Authenticated
可以到Device A和Device B上存在相同的用戶認證信息。
無法設置端口的端口安全模式。
在當前端口的端口安全模式已配置的情況下,無法直接對端口安全模式進行設置。
首先設置端口安全模式為noRestrictions狀態,再設置新的端口安全模式。
[Device-GigabitEthernet1/0/1] undo port-security port-mode
[Device-GigabitEthernet1/0/1] port-security port-mode autolearn
無法配置安全MAC地址。
端口安全模式為非autoLearn時,不能對安全MAC地址進行設置。
設置端口安全模式為autoLearn狀態。
[Device-GigabitEthernet1/0/1] undo port-security port-mode
[Device-GigabitEthernet1/0/1] port-security max-mac-count 64
[Device-GigabitEthernet1/0/1] port-security port-mode autolearn
[Device-GigabitEthernet1/0/1] port-security mac-address security 1-1-2 vlan 1
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!