• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

11-安全配置指导

目录

05-端口安全配置

本章节下载 05-端口安全配置  (546.22 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500G-AF/Configure/Operation_Manual/H3C_S12500G_AF_R7624Pxx-4376/11/202401/2028174_30005_0.htm

05-端口安全配置

  录

1 端口安全

1.1 端口安全简介

1.1.1 端口安全的主要功能

1.1.2 端口安全的特性

1.1.3 端口安全模式

1.1.4 端口安全支持DRNI

1.2 端口安全配置限制和指导

1.3 端口安全配置任务简介

1.4 使能端口安全

1.5 配置端口安全模式

1.6 配置端口安全允许的最大安全MAC地址数

1.7 配置安全MAC地址

1.7.1 功能简介

1.7.2 配置准备

1.7.3 添加安全MAC地址

1.7.4 配置安全MAC地址为无流量老化

1.7.5 将Sticky MAC地址设置为动态类型的安全MAC地址

1.8 配置Need To Know特性

1.9 配置入侵检测特性

1.10 配置DR接口上用户认证的负载分担模式

1.11 配置当前端口不应用下发的授权信息

1.12 配置允许MAC迁移功能

1.13 配置授权失败用户下线功能

1.14 配置指定VLAN内端口安全功能允许同时接入的最大MAC地址数

1.15 配置开放认证模式

1.16 配置端口安全的Free VLAN功能

1.17 配置NAS-ID Profile

1.18 配置端口安全逃生到Critical VSI

1.19 配置端口安全接入用户流量统计功能

1.20 配置端口安全告警功能

1.21 配置端口安全接入用户日志信息功能

1.22 端口安全显示和维护

1.23 端口安全典型配置举例

1.23.1 端口安全autoLearn模式配置举例

1.23.2 端口安全userLoginWithOUI模式配置举例

1.23.3 端口安全macAddressElseUserLoginSecure模式配置举例

1.23.4 端口安全支持DRNI配置举例

1.24 端口安全常见故障处理

1.24.1 端口安全模式无法设置

1.24.2 无法配置安全MAC地址

 


1 端口安全

1.1  端口安全简介

端口安全通过对已有的802.1X认证和MAC地址认证进行融合和扩充,在端口上为使用不同认证方式的用户提供基于MAC地址的网络接入控制。

1.1.1  端口安全的主要功能

·     通过检测端口收到的数据帧中的源MAC地址来控制非授权设备或主机对网络的访问。

·     通过检测从端口发出的数据帧中的目的MAC地址来控制对非授权设备的访问。

·     通过定义各种端口安全模式,控制端口上的MAC地址学习或定义端口上的组合认证方式,让设备学习到合法的源MAC地址,以达到相应的网络管理效果。

1.1.2  端口安全的特性

1. Need To Know特性(NTK)

Need To Know特性通过检测从端口发出的数据帧的目的MAC地址,保证数据帧只能被发送到已经通过认证或被端口学习到的MAC所属的设备或主机上,从而防止非法设备窃听网络数据。

2. 入侵检测(Intrusion Protection)特性

入侵检测特性对端口接收到的数据帧进行检测,源MAC地址未被端口学习到的报文或未通过认证的报文,被认为是非法报文,如果发现非法报文,则对接收非法报文的端口采取相应的安全策略,包括端口被暂时断开连接、永久断开连接或MAC地址被阻塞一段时间,以保证端口的安全性。

1.1.3  端口安全模式

端口安全模式分为两大类:控制MAC学习类和认证类。

·     控制MAC学习类:无需认证,包括端口自动学习MAC地址和禁止MAC地址学习两种模式。

·     认证类:利用MAC地址认证和802.1X认证机制来实现,包括单独认证和组合认证等多种模式。

配置了安全模式的端口上收到用户报文后,首先查找MAC地址表,如果该报文的源MAC地址已经存在于MAC地址表中,则端口转发该报文,否则根据端口所采用的安全模式进行MAC地址学习或者触发相应的认证,并在发现非法报文后触发端口执行相应的安全防护措施(Need To Know、入侵检测)或发送Trap告警。缺省情况下,端口出方向的报文转发不受端口安全限制,若触发了端口Need To Know,则才受相应限制。关于各模式的具体工作机制,以及是否触发Need To Know、入侵检测的具体情况请参见表1-1

表1-1 端口安全模式描述表

端口安全采用方式

安全模式

触发的安全防护措施

关闭端口安全特性

noRestrictions(缺省情况)

表示端口的安全功能关闭,端口处于无限制状态

端口控制MAC地址学习

autoLearn

NTK/入侵检测

secure

端口采用802.1X认证

userLogin

NTK(ntkauto方式)

userLoginSecure

NTK/入侵检测

userLoginSecureExt

userLoginWithOUI

端口采用MAC地址认证

macAddressWithRadius

NTK/入侵检测

端口采用802.1X和MAC地址认证组合认证

Or

macAddressOrUserLoginSecure

NTK/入侵检测

macAddressOrUserLoginSecureExt

Else

macAddressElseUserLoginSecure

macAddressElseUserLoginSecureExt

 

由于安全模式种类较多,为便于记忆,部分端口安全模式的名称可按如下规则理解:

·     “userLogin”表示基于端口的802.1X认证。userLogin之后,若携带“Secure”,则表示基于MAC地址的802.1X认证;若携带“Ext”,则表示可允许多个802.1X用户认证成功,否则表示仅允许一个802.1X用户认证成功。

·     “macAddress”表示MAC地址认证。

·     “Else”之前的认证方式先被采用,失败后根据请求认证的报文协议类型决定是否转为“Else”之后的认证方式。

·     “Or”之后的认证方式先被采用,失败后转为“Or”之前的认证方式。

1. 端口控制MAC地址学习

·     autoLearn

该模式下,端口不会将自动学习到的MAC地址添加为MAC地址表中的动态MAC地址,而是将这些地址添加到安全MAC地址表中,称之为安全MAC地址。也可以通过port-security mac-address security命令手工配置端口下的安全MAC地址。

只有源MAC地址为安全MAC地址、通过命令mac-address dynamicmac-address static手工配置的MAC地址的报文,才能通过该端口。当端口下的安全MAC地址数超过端口安全允许学习的最大安全MAC地址数后,端口模式会自动转变为secure模式。之后,该端口停止添加新的安全MAC。

·     secure

该模式下,禁止端口学习MAC地址,只有源MAC地址为端口上的安全MAC地址、通过命令mac-address dynamicmac-address static手工配置的MAC地址的报文,才能通过该端口。有关MAC地址的详细配置,请参见“二层技术-以太网交换”中的“MAC地址表”。

2. 端口采用802.1X认证

·     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,电气和电子工程师学会)为不同设备供应商分配的一个全球唯一的标识符。

 

3. 端口采用MAC地址认证

macAddressWithRadius:端口对接入用户采用MAC地址认证,且允许多个用户接入。

4. 端口采用802.1X和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地址认证用户。

1.1.4  端口安全支持DRNI

图1-1所示,Device A与Device B形成负载分担,共同进行流量转发,当其中一台设备发生故障时,流量可以快速切换到另一台设备,保证业务的正常运行。

在DRNI组网中,端口安全支持配置DR接口上用户认证的负载分担模式。为保证所有DR接口上送的用户报文都有DR设备进行认证处理,且同一用户的报文同时只在一台DR设备上进行认证处理,端口安全支持如下三种负载分担模式:

·     集中处理模式:该模式下,本端和对端DR接口上送的用户报文都集中到DR主设备处理。

·     分布处理模式:该模式下,DR接口上的用户报文根据分布规则分布到两台DR设备上处理。

¡     本地模式:分布处理本地上送的用户报文,本端DR接口上送的用户报文在本端DR设备处理。

¡     奇偶模式:分布处理本端DR设备和对端DR设备上送的奇偶MAC用户报文。此模式下,两台设备需配置不同的处理模式,若一端设备配置处理奇MAC报文,另一端则需配置为处理偶MAC报文。

当DR接口相连的接入设备上选择了不同的聚合负载分担类型时,通过选择相应的端口安全负载分担模式,可以满足各种聚合负载分担场景下的认证业务需要。

配置DR接口上用户认证的负载分担模式后,若用户在本端DR设备上通过认证,需要将用户数据同步发送到对端DR设备进行备份。当一端DR设备发生故障时,对端DR设备可以使用备份的用户数据接替处理业务,从而保证用户业务的正常运行。

图1-1 端口安全支持DRNI组网示意图

 

1.2  端口安全配置限制和指导

·     由于端口安全特性通过多种安全模式提供了802.1X和MAC地址认证的扩展和组合应用,因此在需要灵活使用以上两种认证方式的组网环境下,推荐使用端口安全特性。无特殊组网要求的情况下,无线环境中通常使用端口安全特性。而在仅需要802.1X、MAC地址认证特性来完成接入控制的组网环境下,推荐单独使用相关特性。关于802.1X、MAC地址认证特性的详细介绍和具体配置请参见“安全配置指导”中的“802.1X”、“MAC地址认证”。

·     目前仅二层以太网接口和二层聚合接口支持配置端口安全功能,且二层以太网聚合接口不支持配置端口安全的secureuserlogin-withoui模式。

·     二层以太网接口加入聚合组后,在该接口上配置的端口安全功能不生效。

·     在二层聚合接口上有802.1X或MAC地址认证用户在线的情况下,请不要删除该二层聚合接口。

·     DRNI场景下,在设备上开启RADIUS DAE服务后,设备不支持通过COA请求报文关闭/重启802.1X、MAC地址认证和Web认证用户接入端口或重认证用户。关于RADIUS DAE服务详细信息请参见“安全配置指导”中的“AAA”。

1.3  端口安全配置任务简介

端口安全配置任务如下:

(1)     配置端口安全基本功能

¡     使能端口安全

¡     配置端口安全模式

¡     (可选)配置端口安全允许的最大安全MAC地址数

¡     (可选)配置安全MAC地址

¡     (可选)配置Need To Know特性

¡     (可选)配置入侵检测特性

¡     配置DR接口上用户认证的负载分担模式

仅在DRNI组网中需要完成本配置。

(2)     (可选)配置端口安全扩展功能

¡     配置当前端口不应用下发的授权信息

¡     配置允许MAC迁移功能

¡     配置授权失败用户下线功能

¡     配置指定VLAN内端口安全功能允许同时接入的最大MAC地址数

¡     配置开放认证模式

¡     配置端口安全的Free VLAN功能

¡     配置NAS-ID Profile

¡     配置端口安全逃生到Critical VSI

¡     配置端口安全接入用户流量统计功能

以上端口安全扩展功能,在未使能端口安全,但开启802.1X或MAC地址认证功能的情况下也适用。

(3)     (可选)配置端口安全告警功能

(4)     (可选)配置端口安全接入用户日志信息功能

1.4  使能端口安全

1. 配置限制和指导

·     当端口安全处于使能状态时,不能开启端口上的802.1X以及MAC地址认证,且不能修改802.1X端口接入控制方式和端口授权状态,它们只能随端口安全模式的改变由系统更改。

·     可以通过undo port-security enable命令关闭端口安全。但需要注意的是,在端口上有用户在线的情况下,关闭端口安全会导致在线用户下线。

·     执行使能或关闭端口安全的命令后,端口上的如下配置会被自动恢复为以下缺省情况:

¡     802.1X端口接入控制方式为macbased

¡     802.1X端口的授权状态为auto

有关802.1X认证配置的详细介绍可参见“安全配置指导”中的“802.1X”。有关MAC地址认证配置的详细介绍可参见“安全配置指导”中的“MAC地址认证”。

2. 配置准备

在使能端口安全之前,需要关闭全局的802.1X和MAC地址认证。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     使能端口安全。

port-security enable

缺省情况下,端口安全功能处于关闭状态。

1.5  配置端口安全模式

1. 配置限制和指导

·     在端口安全未使能的情况下,端口安全模式可以进行配置但不会生效。

·     端口上有用户在线的情况下,改变端口的安全模式会导致在线用户会下线。

·     如果端口上已经配置了端口安全模式,则不允许开启802.1X认证和MAC地址认证。

·     当端口安全已经使能且当前端口安全模式不是noRestrictions时,若要改变端口安全模式,必须首先执行undo port-security port-mode命令恢复端口安全模式为noRestrictions模式。

·     端口安全模式为macAddressWithRadiusmacAddressElseUserLoginSecuremacAddressElseUserLoginSecureExtuserLoginSecureuserLoginSecureExtmacAddressOrUserLoginSecuremacAddressOrUserLoginSecureExtuserLoginWithOUI,设备支持RADIUS扩展属性下发重定向URL。即:用户认证后,设备会根据RADIUS服务器下发的重定向URL属性,将用户的HTTP或HTTPS请求重定向到指定的Web认证页面。Web认证通过后,RADIUS服务器记录用户的MAC地址,并通过DM报文强制Web用户下线。此后该用户再次发起802.1X认证或MAC地址认证,由于RADIUS服务器上已记录该用户和其MAC地址的对应信息,用户可以成功上线。

·     若需要对用户的HTTPS请求进行重定向,需要在设备上配置对HTTPS报文进行重定向的内部侦听端口号,具体配置请参见“三层技术-IP业务配置指导”中的“HTTP重定向”。

2. 配置准备

在配置端口安全模式之前,端口上首先需要满足以下条件:

·     802.1X认证关闭。

·     MAC地址认证关闭。

·     端口未加入业务环回组。

·     对于autoLearn模式,还需要提前设置端口安全允许的最大安全MAC地址数。但是如果端口已经工作在autoLearn模式下,则无法更改端口安全允许的最大安全MAC地址数。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     配置允许通过认证的用户OUI值。

port-security oui index index-value mac-address oui-value

缺省情况下,不存在允许通过认证的用户OUI值。

该命令仅在端口安全模式为userLoginWithOUI时必选。在这种情况下,端口除了可以允许一个802.1X的接入用户通过认证之外,仅允许一个与某OUI值匹配的用户通过认证。

(3)     进入接口视图。

interface interface-type interface-number

(4)     配置端口的安全模式。

port-security port-mode { autolearn | 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模式。

1.6  配置端口安全允许的最大安全MAC地址数

1. 功能简介

端口安全允许某个端口下有多个用户接入,但是允许的用户数不能超过规定的最大值。

配置端口允许的最大安全MAC地址数有两个作用:

·     控制端口允许接入网络的最大用户数。对于采用802.1X、MAC地址认证或者两者组合形式的认证类安全模式,端口允许的最大用户数取本命令配置的值与相应模式下允许认证用户数的最小值;

·     控制autoLearn模式下端口能够添加的最大安全MAC地址数。如果配置了vlan关键字,但未指定具体的vlan-id-list时,可控制接口允许的每个VLAN内的最大安全MAC地址数;否则表示控制指定vlan-id-list内的最大安全MAC地址数。

端口安全允许的最大安全MAC地址数与“二层技术-以太网交换配置指导/MAC地址表”中配置的端口最多可以学习到的MAC地址数无关,且不受其影响。

2. 配置步骤

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置端口安全允许的最大安全MAC地址数。

port-security max-mac-count max-count [ vlan [ vlan-id-list ] ]

缺省情况下,端口安全不限制本端口可保存的最大安全MAC地址数。

1.7  配置安全MAC地址

1.7.1  功能简介

安全MAC地址是一种特殊的MAC地址,保存配置后重启设备,不会丢失。在同一个VLAN内,一个安全MAC地址只能被添加到一个端口上。

安全MAC地址可以通过以下两种途径生成:

·     由autoLearn安全模式下的使能端口安全功能的端口自动学习。

·     通过命令行手动添加。

缺省情况下,所有的安全MAC地址均不老化,除非被管理员通过命令行手工删除,或因为配置的改变(端口的安全模式被改变,或端口安全功能被关闭)而被系统自动删除。但是,安全MAC地址不老化会带来一些问题:合法用户离开端口后,若有非法用户仿冒合法用户源MAC接入,会导致合法用户不能继续接入;虽然该合法用户已离开,但仍然占用端口MAC地址资源,而导致其它合法用户不能接入。因此,让某一类安全MAC地址能够定期老化,可提高端口接入的安全性和端口资源的利用率。

表1-2 安全MAC地址相关属性列表

类型

生成方式

配置保存机制

老化机制

静态

手工添加(未指定sticky关键字)

安全MAC地址在保存配置文件并重启设备后,仍然存在

不老化

Sticky

手工添加(指定sticky关键字),或端口自动学习

Sticky MAC地址在保存配置文件并重启设备后,仍然存在,且其老化定时器会重新开始计时

Sticky MAC地址可通过配置转换为动态类型的MAC地址。动态类型的安全MAC地址不能被保存在配置文件中,设备重启后会被丢失

支持两种老化机制:

·     定时老化。若老化时间为0,则表示不老化(缺省)

·     无流量老化。设备会定期检测端口上的安全MAC地址是否有流量产生,若某安全MAC地址在配置的Sticky MAC地址老化时间内没有任何流量产生,则才会被老化

 

当端口下的安全MAC地址数目超过端口允许学习的最大安全MAC地址数后,端口安全模式变为secure模式。该模式下,禁止端口学习MAC地址,只有源MAC地址为端口上的安全MAC地址或通过命令mac-address dynamicmac-address static手工配置的MAC地址的报文,才能通过该端口。

1.7.2  配置准备

在配置安全MAC地址之前,需要完成以下配置任务:

·     设置端口安全允许的最大MAC地址数。

·     配置端口安全模式为autoLearn。

·     当前的接口必须允许指定的VLAN通过或已加入该VLAN,且该VLAN已存在。

1.7.3  添加安全MAC地址

(1)     进入系统视图。

system-view

(2)     配置安全MAC地址的老化时间。

port-security timer autolearn aging [ second ] time-value

缺省情况下,安全MAC地址不会老化。

(3)     在系统视图或接口视图下配置安全MAC地址。

¡     在系统视图下配置安全MAC地址。

port-security mac-address security [ sticky ] mac-address interface interface-type interface-number vlan vlan-id

¡     依次执行以下命令在接口视图下配置安全MAC地址。

interface interface-type interface-number

port-security mac-address security [ sticky ] mac-address vlan vlan-id

缺省情况下,未配置安全MAC地址。

与相同VLAN绑定的同一个MAC地址不允许同时指定为静态类型的安全MAC地址和Sticky MAC地址。

1.7.4  配置安全MAC地址为无流量老化

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置安全地址的老化方式为无流量老化。

port-security mac-address aging-type inactivity

缺省情况下,安全MAC地址按照配置的老化时间进行老化,即在配置的安全MAC地址的老化时间到达后立即老化,不论该安全MAC地址是否还有流量产生。

1.7.5  将Sticky MAC地址设置为动态类型的安全MAC地址

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     将Sticky MAC地址设置为动态类型的安全MAC地址。

port-security mac-address dynamic

缺省情况下,Sticky MAC地址能够被保存在配置文件中,设备重启后也不会丢失。

1.8  配置Need To Know特性

1. 配置步骤

Need To Know特性用来限制端口上出方向的报文转发,可支持以下几种限制方式:

·     ntkonly:仅允许目的MAC地址为已知MAC地址的单播报文通过。

·     ntk-withbroadcasts:允许广播地址报文、目的MAC地址为已知MAC地址的单播报文通过。

·     ntk-withmulticasts:允许广播地址报文、组播地址报文和目的MAC地址为已知MAC地址的单播报文通过。

·     ntkauto:仅当有用户认证上线后,才允许广播地址报文、组播地址报文和目的MAC地址为已知MAC地址的单播报文通过。

2. 配置限制和指导

配置了Need To Know的端口在以上任何一种方式下都不允许目的MAC地址未知的单播报文通过。

并非所有的端口安全模式都支持Need To Know特性,配置时需要先了解各模式对此特性的支持情况,具体请参见表1-1

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置端口Need To Know特性。

port-security ntk-mode { ntk-withbroadcasts | ntk-withmulticasts | ntkauto | ntkonly }

缺省情况下,端口没有配置Need To Know特性,即所有报文都可成功发送。

1.9  配置入侵检测特性

1. 功能简介

当设备检测到一个非法的用户通过端口试图访问网络时,入侵检测特性用于配置设备可能对其采取的安全措施,包括以下三种方式:

·     blockmac:表示将非法报文的源MAC地址加入阻塞MAC地址列表中,源MAC地址为阻塞MAC地址的报文将被丢弃。此MAC地址在被阻塞一段时间后恢复正常。阻塞时长可通过port-security timer blockmac命令配置。

·     disableport:表示将收到非法报文的端口永久关闭。

·     disableport-temporarily:表示将收到非法报文的端口暂时关闭一段时间。关闭时长可通过port-security timer disableport命令配置。

2. 配置限制和指导

macAddressElseUserLoginSecure或macAddressElseUserLoginSecureExt安全模式下工作的端口,对于同一个报文,只有MAC地址认证和802.1X认证均失败后,才会触发入侵检测特性。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置入侵检测特性。

port-security intrusion-mode { blockmac | disableport | disableport-temporarily }

缺省情况下,不进行入侵检测处理。

(4)     退回系统视图。

quit

(5)     (可选)配置系统暂时关闭端口的时间。

port-security timer disableport time-value

缺省情况下,系统暂时关闭端口的时间为20秒。

(6)     (可选)配置将非法报文的源MAC地址加入阻塞MAC地址列表的时间。

port-security timer blockmac time-value

缺省情况下,将非法报文的源MAC地址加入阻塞MAC地址列表的时间为180秒。

1.10  配置DR接口上用户认证的负载分担模式

1. 功能简介

为保证所有DR接口上送的用户报文都有DR设备处理,且同一用户的报文同时只在一台DR设备上处理,可以按如下方式配置两台DR设备上的用户认证的负载分担模式:

·     两台DR设备都配置集中处理模式。

·     两台DR设备都配置分布处理模式且分布规则为local

·     两台DR设备都配置分布处理模式且其中一台DR设备配置分布规则为odd-mac,另一台DR设备配置分布规则为even-mac

2. 配置限制和指导

·     本命令仅对802.1X、MAC地址认证和Web认证用户生效。

·     DRNI场景下,两台DR设备通过交换各自的配置信息,检查配置是否冲突,检查过程不影响DR设备转发报文。若配置冲突,将不允许新用户上线。

·     为防止配置冲突导致用户下线,请勿在端口安全、802.1X、MAC地址认证或Web认证使能的情况下,修改DR接口上用户认证的负载分担模式配置。

·     当指定DR接口上用户认证的负载分担模式为local时,必须保证与DR接口相连的接入设备上配置的聚合负载分担类型为按报文的目的IP地址进行聚合负载分担、按报文的目的MAC地址进行聚合负载分担、按报文的源IP地址进行聚合负载分担或按报文的源MAC地址进行聚合负载分担,否则会导致用户数据处理异常。

·     对于802.1X认证场景,还必须保证与DR接口相连的接入设备上配置缺省聚合负载分担时忽略除报文的源MAC地址之外的其它字段。

关于DRNI的详细介绍请参见“二层技术-以太网交换配置指导”中的“DRNI”,关于聚合负载分担的详细介绍请参见“二层技术-以太网交换配置指导”中的“以太网链路聚合”

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     配置DR接口上用户认证的负载分担模式。

port-security drni load-sharing-mode { centralized | distributed { even-mac | local | odd-mac } }

缺省情况下,DR接口上用户认证的负载分担模式为分布处理本地上送用户。

1.11  配置当前端口不应用下发的授权信息

1. 功能简介

802.1X用户或MAC地址认证用户通过本地认证或RADIUS认证时,本地设备或远程RADIUS服务器会把授权信息下发给用户。通过此配置可实现端口是否忽略这类下发的授权信息。

2. 配置步骤

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置当前端口不应用RADIUS服务器或设备本地下发的授权信息。

port-security authorization ignore

缺省情况下,端口应用RADIUS服务器或设备本地下发的授权信息。

1.12  配置允许MAC迁移功能

1. 功能简介

允许MAC迁移功能是指,允许在线的802.1X用户、MAC地址认证用户或Web认证用户迁移到设备的其它端口上或迁移到同一端口下的其它VLAN接入后可以重新认证上线。

对于迁移到设备其它端口接入的用户,缺省情况下,如果用户从某一端口上线成功,则该用户在未从当前端口下线的情况下无法在设备的其它端口上(无论该端口是否与当前端口属于同一VLAN)发起认证,也无法上线。若开启了允许MAC地址迁移功能,则允许在线用户离开当前端口在设备的其它端口上(无论该端口是否与当前端口属于同一VLAN)发起认证。如果该用户在后接入的端口上认证成功,则当前端口会将该用户立即进行下线处理,保证该用户仅在一个端口上处于上线状态。

对于Trunk和Hybrid端口下的用户,在用户报文携带VLAN Tag时可以迁移到同一端口下的其它VLAN(指不同于上一次发起认证时所在的VLAN)内接入。缺省情况下,如果用户从端口下的某个VLAN上线成功,则当该用户迁移到同一端口下的其它VLAN内发起认证,用户认证失败。若开启了允许MAC地址迁移功能,则用户在新VLAN可以认证成功,并且端口会对迁移前的在线用户立即进行下线处理,保证该用户仅在一个VLAN上处于上线状态。

缺省情况下,端口开启MAC VLAN功能后,若用户上线成功并授权了VLAN,则当用户通过MAC迁移方式在其它端口上线时,用户发送的802.1X、MAC地址认证或Web认证报文中会携带初始认证端口授权的VLAN信息。此时新端口会对用户认证的报文中携带的VLAN信息进行检查,如果用户所在VLAN不在新端口允许通过的VLAN范围内,则不允许用户进行MAC迁移。为了避免这种情况的发生,可以开启允许MAC迁移不检查VLAN功能。

2. 配置限制和指导

通常,不建议开启该功能,只有在用户漫游迁移需求的情况下建议开启此功能。

如果用户进行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”。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     开启允许MAC迁移功能。

port-security mac-move permit [ port | vlan ]

缺省情况下,允许MAC迁移功能处于关闭状态。

(3)     (可选)配置允许MAC迁移不检查VLAN功能。

a.     进入接口视图。

interface interface-type interface-number

b.     开启允许MAC迁移不检查VLAN功能。

port-security mac-move bypass-vlan-check

缺省情况下,允许MAC迁移不检查VLAN功能处于关闭状态。

1.13  配置授权失败用户下线功能

1. 功能简介

接口上开启授权失败用户下线功能后,当服务器下发的授权信息(目前仅支持ACL、User Profile)在设备上不存在或者设备下发授权信息失败时,设备将强制用户下线。该功能用于配合服务器上的用户授权控制策略,它仅允许接口上成功下发了授权信息的用户在线。

对于授权VLAN失败的情况,设备会直接让用户下线,与此功能无关。

开启本功能时:

·     若不指定任何参数,用户下线之后,设备再次收到该用户的报文就对其进行认证处理。

·     若指定quiet-period参数,则表示开启用户授权失败下线静默功能。用户下线后,设备将其加入对应认证类型的静默队列,并根据对应认证类型的静默定时器的值来确定用户认证失败以后,设备停止对其提供认证服务的时间间隔。在静默期间,设备不对来自认证失败用户的报文进行认证处理,直接丢弃;静默期后,设备再次收到该用户的报文,则对其进行认证处理。

2. 配置准备

若开启本功能时指定了quiet-period参数则需要先完成如下配置:

·     对于802.1X用户,通过dot1x quiet-period命令开启802.1X认证静默定时器功能,并通过dot1x timer quiet-period令设置静默定时器的值。

·     对于MAC地址认证用户,通过mac-authentication timer quiet命令配置MAC地址认证静默定时器的值。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     开启授权失败用户下线功能。

port-security authorization-fail offline [ quiet-period ]

缺省情况下,授权失败用户下线功能处于关闭状态,即授权失败后用户保持在线。

1.14  配置指定VLAN内端口安全功能允许同时接入的最大MAC地址数

1. 功能简介

通常情况下,端口上端口安全功能允许接入的MAC地址包括:

·     端口上MAC地址认证成功用户的MAC地址;MAC地址认证Guest VLAN、Critical VLAN中用户的MAC地址;MAC地址认证Guest VSI和Critical VSI中的用户的MAC地址;MAC地址认证Critical微分段中的用户的MAC地址。

·     802.1X认证成功用户的MAC地址;802.1X认证Guest VLAN、Auth-Fail VLAN、Critical VLAN中用户的MAC地址;802.1X认证Guest VSI、Auth-Fail VSI、Critical VSI中用户的MAC地址。

·     Web认证成功用户的MAC地址;Web认证Auth-Fail VLAN中用户的MAC地址。

由于系统资源有限,如果当前端口上允许接入的MAC地址数过多,接入MAC地址之间会发生资源的争用,因此适当地配置端口安全功能允许同时接入的最大MAC地址数可以使属于当前端口的用户获得可靠的性能保障。当指定VLAN内,端口允许接入的MAC地址数超过最大值后,该VLAN内新接入的MAC地址将被拒绝。

2. 配置限制和指导

配置的端口上指定VLAN内端口安全功能允许同时接入的最大MAC地址数,不能小于当前端口上相应VLAN已存在的MAC地址数;否则,本次配置不生效。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置指定VLAN内端口安全功能允许同时接入的最大MAC地址数。

port-security mac-limit max-number per-vlan vlan-id-list

缺省情况下,端口上端口安全功能允许同时接入的最大MAC地址数为2147483647。

1.15  配置开放认证模式

1. 功能简介

开启开放认证模式后,端口上的802.1X、MAC地址认证用户在接入时即使接入信息不正确(包含不存在的用户名或者错误的密码两种情况)也可以正常接入并访问网络。在这种模式下接入的用户被称为open用户,此类用户不支持授权和计费,但可通过display dot1x connection opendisplay mac-authentication connection open命令可以查看用户信息。当开启端口安全的开放认证模式后,不影响接入信息正确的用户正常上线,此类不属于open用户。

2. 配置限制和指导

·     开启了全局端口安全的开放认证模式后,开放认证模式在所有端口生效;未开启全局端口安全开放认证模式时,开放认证模式以端口上配置为准。

·     开放认证模式优先级低于802.1X的Auth-Fail VLAN和MAC地址认证的Guest VLAN,即如果端口上配置了802.1X的Auth-Fail VLAN或MAC地址认证的Guest VLAN,密码错误的接入用户会加入认证失败VLAN,开放认证模式不生效。有关802.1X、MAC地址认证的详细介绍,请参见“安全配置指导”中的“802.1X”和“MAC地址认证”。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     配置全局开放认证模式。

port-security authentication open global

缺省情况下,全局端口安全的开放认证模式处于关闭状态。

(3)     进入接口视图。

interface interface-type interface-number

(4)     配置端口开放认证模式。

port-security authentication open

缺省情况下,接口端口安全的开放认证模式处于关闭状态。

1.16  配置端口安全的Free VLAN功能

1. 功能简介

开启802.1X认证、MAC地址认证或端口安全功能并配置了端口安全模式为userLogin、userLoginSecure、userLoginWithOUI、userLoginSecureExt、macAddressWithRadius、macAddressOrUserLoginSecure、macAddressElseUserLoginSecure、macAddressOrUserLoginSecureExt或macAddressElseUserLoginSecureExt时,若配置了端口安全的Free VLAN功能,则Free VLAN内的流量不需要进行认证,设备直接转发。

2. 配置步骤

(1)     进入系统视图。

system-view

(2)     进入接口视图。

interface interface-type interface-number

(3)     配置端口安全的Free VLAN。

port-security free-vlan vlan-id-list

缺省情况下,未配置端口安全的Free VLAN。

1.17  配置NAS-ID Profile

1. 功能简介

用户的接入VLAN可标识用户的接入位置,而在某些应用环境中,网络运营商需要使用接入设备发送给RADIUS服务器的NAS-Identifier属性值来标识用户的接入位置,因此接入设备上需要建立用户接入VLAN与指定的NAS-ID之间的绑定关系。这样,当用户上线时,设备会将与用户接入VLAN匹配的NAS-ID填充在RADIUS请求报文中的NAS-Identifier属性中发送给RADIUS服务器。

2. 配置限制和指导

NAS-ID Profile可以在系统视图下或者接口视图下进行配置,接口上的配置优先,若接口上没有配置,则使用系统视图下的全局配置。

如果指定了NAS-ID Profile,则此Profile中定义的绑定关系优先使用;如果未指定NAS-ID Profile或指定的Profile中没有找到匹配的绑定关系,则使用设备名作为NAS-ID。

NAS-ID与VLAN的绑定关系的配置请参考“安全配置指导”中的“AAA”。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     在系统视图或接口视图下指定引用的NAS-ID Profile。

¡     系统视图下指定引用的NAS-ID Profile。

port-security nas-id-profile profile-name

¡     依次执行以下命令在接口视图下指定引用的NAS-ID Profile。

interface interface-type interface-number

port-security nas-id-profile profile-name

缺省情况下,未指定引用的NAS-ID Profile。

1.18  配置端口安全逃生到Critical VSI

1. 功能简介

在VXLAN网络中,当802.1X或MAC地址认证接入用户采用RADIUS远程认证/授权方式,且RADIUS服务器异常(服务器可达但认证/授权失败)时,可开启端口安全逃生到Critical VSI功能。

开启了端口安全逃生到Critical VSI功能,且配置了MAC地址认证的强制端口上授权了重定向URL的MAC地址认证用户下线功能(通过mac-authentication critical vsi critical-vsi-name url-user-logoff命令,详细配置请参见“安全配置指导”中的“MAC地址认证”)后,首先端口上被授权了重定向URL的MAC地址认证用户将被强制下线;之后设备的对应端口如果收到源MAC地址未知的报文或802.1X认证请求报文,会根据用户的接入端口、所属VLAN和MAC地址信息动态创建以太网服务实例,并将该以太网服务实例与802.1X Critical VSI或MAC地址认证Critical VSI相关联;此后,通过该端口接入的、指定VLAN和MAC地址的用户无需认证,直接被授权访问Critical VSI对应的VXLAN中的网络资源,这种情况下Critical VSI也称为逃生VSI。

 

2. 配置准备

在开启端口安全逃生到Critical VSI之前,需要先配置802.1X Critical VSI或MAC地址认证Critical VSI,否则逃生无法生效,802.1X用户或MAC地址认证用户不能访问任何VXLAN中的资源。

关于802.1X Critical VSI和MAC地址认证Critical VSI的详细介绍和具体配置请参见“安全配置指导”中的“802.1X”、“MAC地址认证”。

3. 配置限制和指导

·     配置端口安全逃生到Critical VSI时,请保证设备端口上没有Web认证、802.1X Guest VLAN、Auth-Fail VLAN、Critical VLAN或MAC地址认证的Guest VLAN、Critical VLAN的配置,否则该端口的逃生功能无法正常使用。

·     配置端口逃生到Critical VSI后,如下802.1X或MAC地址认证用户不支持逃生:

¡     802.1X客户端采用的认证类型(EAP中继或EAP终结)与设备配置不一致;

¡     开启了802.1X认证的MAC地址绑定功能的端口上,用户的MAC地址不在MAC地址绑定表项中;

¡     用户MAC地址为全0、全F(广播MAC)和组播MAC。

·     端口安全逃生到Critical VSI支持全局配置和端口配置,全局配置在设备的所有端口上生效,端口配置则只对指定端口生效。

·     删除全局和端口上的逃生VSI后,通过该端口接入的逃生用户将会被删除,用户再上线时为正常的认证流程。

4. 配置步骤

(1)     进入系统视图。

system-view

(2)     在系统视图或接口视图下开启端口安全逃生到Critical VSI。

¡     系统视图下开启全局端口安全逃生到Critical VSI。

port-security global escape critical-vsi

¡     依次执行以下命令在接口视图下开启端口安全逃生到Critical VSI。

interface interface-type interface-number

port-security escape critical-vsi

缺省情况下,端口安全逃生到Critical VSI功能处于关闭状态。

1.19  配置端口安全接入用户流量统计功能

1. 功能简介

端口安全接入用户流量统计功能是指对在线的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认证时,设备基于用户接入端口统计流量。

2. 配置限制和指导

本功能仅对新上线的802.1X和MAC地址认证用户生效,对开启前已在线的802.1X和MAC地址认证用户不生效。

统计802.1X和MAC地址认证用户流量时,需要占用设备的ACL资源。当在线的802.1X和MAC地址认证用户数量较多的情况下,开启该功能会占用设备大量ACL资源,可能导致新认证的802.1X和MAC地址认证用户上线不成功。因此当没有通过用户流量进行计费的需求时,建议关闭此功能。

有关802.1X、MAC地址认证的详细介绍,请参见“安全配置指导”中的“802.1X”和“MAC地址认证”。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     开启端口安全用户流量统计功能。

port-security traffic-statistics enable

缺省情况下,端口安全用户流量统计功能处于关闭状态。

1.20  配置端口安全告警功能

1. 功能简介

开启端口安全告警功能后,该模块会生成告警信息,用于报告该模块的重要事件。生成的告警信息将发送到设备的SNMP模块,通过设置SNMP中告警信息的发送参数,来决定告警信息输出的相关属性。有关告警信息的详细介绍,请参见“网络管理和监控配置指导”中的“SNMP”。

2. 配置步骤

(1)     进入系统视图。

system-view

(2)     打开指定告警信息的开关。

snmp-agent trap enable port-security [ address-learned | dot1x-failure | dot1x-logoff | dot1x-logon | intrusion | mac-auth-failure | mac-auth-logoff | mac-auth-logon ] *

缺省情况下,所有告警信息的开关处于关闭状态。

1.21  配置端口安全接入用户日志信息功能

1. 功能简介

端口安全接入用户日志信息是为了满足网络管理员维护的需要,对用户的接入信息进行记录。设备生成的端口安全日志信息会交给信息中心模块处理,信息中心模块的配置将决定日志信息的发送规则和发送方向。关于信息中心的详细描述请参见“网络管理和监控配置指导”中的“信息中心”。

2. 配置限制和指导

为了防止设备输出过多的端口安全接入用户日志信息,一般情况下建议关闭此功能。

3. 配置步骤

(1)     进入系统视图。

system-view

(2)     开启端口安全接入用户日志信息功能。

port-security access-user log enable [ failed-authorization | mac-learning | violation | vlan-mac-limit ] *

缺省情况下,端口安全接入用户日志信息功能处于关闭状态。

配置本命令时,如果未指定任何参数,将同时开启所有参数对应的日志功能。

1.22  端口安全显示和维护

在完成上述配置后,在任意视图下执行display命令可以显示配置后端口安全的运行情况,通过查看显示信息验证配置的效果。

表1-3 端口安全显示和维护

操作

命令

显示端口安全的配置信息、运行情况和统计信息

display port-security [ interface interface-type interface-number ]

显示安全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 ]

 

1.23  端口安全典型配置举例

1.23.1  端口安全autoLearn模式配置举例

1. 组网需求

在Device的端口HundredGigE3/0/1上对接入用户做如下的限制:

·     允许64个用户自由接入,不进行认证,将学习到的用户MAC地址添加为Sticky MAC地址,老化时间为30分钟;

·     当安全MAC地址数量达到64后,停止学习;当再有新的MAC地址接入时,触发入侵检测,并将此端口关闭30秒。

2. 组网图

图1-2 端口安全autoLearn模式组网图

3. 配置步骤

# 使能端口安全。

<Device> system-view

[Device] port-security enable

# 设置安全MAC地址的老化时间为30分钟。

[Device] port-security timer autolearn aging 30

# 设置端口安全允许的最大安全MAC地址数为64。

[Device] interface hundredgige 3/0/1

[Device-HundredGigE3/0/1] port-security max-mac-count 64

# 设置端口安全模式为autoLearn。

[Device-HundredGigE3/0/1] port-security port-mode autolearn

# 设置触发入侵检测特性后的保护动作为暂时关闭端口,关闭时间为30秒。

[Device-HundredGigE3/0/1] port-security intrusion-mode disableport-temporarily

[Device-HundredGigE3/0/1] quit

[Device] port-security timer disableport 30

4. 验证配置

上述配置完成后,可以使用如下显示命令查看端口安全的配置情况。

[Device] display port-security interface hundredgige 3/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

   Traffic-statistics    : Disabled

   OUI value list         :

    Index :  1           Value : 123401

 

 HundredGigE3/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

   Free VLANs                     : Not configured

   Open authentication            : Disabled

可以看到端口安全所允许的最大安全MAC地址数为64,端口模式为autoLearn,入侵检测保护动作为DisablePortTemporarily,入侵发生后端口被禁用时间为30秒。

配置生效后,端口允许地址学习,学习到的MAC地址数可在上述显示信息的“Current number of secure MAC addresses”字段查看到,具体的MAC地址信息可以在接口视图下用display this命令查看。

[Device] interface hundredgige 3/0/1

[Device-HundredGigE3/0/1] display this

#

interface HundredGigE3/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地址。

1.23.2  端口安全userLoginWithOUI模式配置举例

1. 组网需求

客户端通过端口HundredGigE3/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分钟,发送的用户名不带域名。

·     端口HundredGigE3/0/1同时允许一个802.1X用户以及一个与指定OUI值匹配的设备接入。

2. 组网图

图1-3 端口安全userLoginWithOUI模式组网图

3. 配置步骤

说明

·     下述配置步骤包含了部分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 hundredgige 3/0/1

[Device-HundredGigE3/0/1] dot1x mandatory-domain sun

[Device-HundredGigE3/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 hundredgige 3/0/1

[Device-HundredGigE3/0/1] port-security port-mode userlogin-withoui

[Device-HundredGigE3/0/1] quit

4. 验证配置

# 查看端口安全的配置信息。

[Device] display port-security interface hundredgige 3/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

   Traffic-statistics    : Disabled

   OUI value list         :

       Index :  1       Value : 123401

       Index :  2       Value : 123402

       Index :  3       Value : 123403

       Index :  4       Value : 123404

       Index :  5       Value : 123405

 

 HundredGigE3/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

   Free VLANs                     : Not configured

   Open authentication            : Disabled

配置完成后,如果有802.1X用户上线,则可以通过上述显示信息看到当前端口保存的MAC地址数为1。还可以通过display dot1x命令查看该802.1X用户的在线情况。

此外,端口还允许一个MAC地址与OUI值匹配的用户通过,可以通过下述命令查看。

[Device] display mac-address interface hundredgige 3/0/1

MAC Address     VLAN ID   State          Port/NickName            Aging

1234-0300-0011  1         Learned        HGE1/0/1                 Y

1.23.3  端口安全macAddressElseUserLoginSecure模式配置举例

1. 组网需求

客户端通过端口HundredGigE3/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特性。

2. 组网图

图1-4 端口安全macAddressElseUserLoginSecure模式组网图

3. 配置步骤

说明

·     RADIUS认证/计费及ISP域的配置同“1.23.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 hundredgige 3/0/1

[Device-HundredGigE3/0/1] port-security max-mac-count 64

# 设置端口安全模式为macAddressElseUserLoginSecure。

[Device-HundredGigE3/0/1] port-security port-mode mac-else-userlogin-secure

# 指定端口上接入的802.1X用户使用强制认证域sun。

[Device-HundredGigE3/0/1] dot1x mandatory-domain sun

[Device-HundredGigE3/0/1] quit

# 设置端口Need To Know模式为ntkonly

[Device-HundredGigE3/0/1] port-security ntk-mode ntkonly

[Device-HundredGigE3/0/1] quit

4. 验证配置

# 查看端口安全的配置信息。

[Device] display port-security interface hundredgige 3/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

   Traffic-statistics    : Disabled

   OUI value list

 

 HundredGigE3/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

   Free VLANs                     : Not configured

   Open authentication            : Disabled

配置完成后,如果有用户认证上线,则可以通过下述显示信息看到当前端口上的用户认证信息。

# 查看MAC地址认证信息。

[Device] display mac-authentication interface hundredgige 3/0/1

 Global MAC authentication parameters:

   MAC authenticaiton                  : Enabled

   Authentication method               : PAP

   User name format                    : MAC address in uppercase(XX-XX-XX-XX-XX-XX)

           Username                    : mac

           Password                    : Not configured

   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

   Authentication domain               : sun

 Online MAC-auth wired users           : 3

 

 Silent MAC users:

          MAC address       VLAN ID  From port               Port index

 

HundredGigE3/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

 

   Guest VSI                        : Not configured

   Guest VSI auth-period            : 30 s

   Critical VSI                     : Not configured

   Max online users                 : 4294967295

   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 hundredgige 3/0/1

 Global 802.1X parameters:

   802.1X authentication                : Enabled

   DR 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

   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

 

 HundredGigE3/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

   Critical voice VLAN              : Disabled

   Add Guest VLAN delay             : Disabled

   Re-auth server-unreachable       : Logoff

   Max online users                 : 4294967295

   User IP freezing                 : Disabled

   Reauth period                    : 60 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

 

   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地址未知、广播和多播报文都被丢弃。

1.23.4  端口安全支持DRNI配置举例

1. 组网需求

客户端经过Device A和Device B接入网络,由Device A和Device B对用户进行身份认证,具体需求如下:

·     采用RADIUS服务器对用户进行认证/授权/计费。

·     Device A和Device B组成DR系统,正常工作时链路进行负载分担且任何一台设备故障对业务均没有影响,保证用户业务的高可靠性。

·     Device A和Device B的DR接口上对用户采用macAddressWithRadius认证模式,且对用户报文进行负载分担,负载分担的模式为本端DR接口上送的用户报文在本端DR设备处理。

·     DR系统中的一台DR设备发生故障时,要求该故障设备上的用户发送的RADIUS报文的源IP始终保持不变,且使用DRNI虚拟IP地址。

2. 组网图

图1-5 端口安全支持DRNI典型配置组网图

设备

接口

DRNI接口

IP地址

Device A(DR1)

HGE3/0/1

Keepalive链路接口

1.1.1.2/24

BAGG1(HGE3/0/2)

IPP口

-

BAGG2(HGE3/0/4)

DR接口

-

BAGG3(HGE3/0/3)

DR接口

-

Vlan-int 2

-

10.1.1.1/24

Device B(DR2)

HGE3/0/1

Keepalive链路接口

1.1.1.1/24

BAGG1(HGE3/0/2)

IPP口

-

BAGG2(HGE3/0/4)

DR接口

-

BAGG3(HGE3/0/3)

DR接口

-

Vlan-int 2

-

-

3. 配置限制和指导

下述配置步骤包含了部分AAA/RADIUS协议配置命令,具体介绍请参见“安全配置指导”中的“AAA”。

下述配置步骤包含了部分DRNI配置命令,具体介绍请参见“二层技术-以太网交换配置指导”中的“DRNI”。

4. 配置准备

保证接入用户和RADIUS服务器之间路由可达。

配置RADIUS服务器,添加用户账户,保证用户的认证/授权/计费功能正常运行。

5. 配置步骤

(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

# 配置本端DR接口接入的用户发送RADIUS报文使用的源IP地址为10.1.1.1,对端DR接口接入的用户发送RADIUS报文使用的源IP地址为10.1.1.2。

[DeviceA-radius-radsun] nas-ip drni local 10.1.1.1

[DeviceA-radius-radsun] nas-ip drni 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

¡     配置DRNI。

# 系统配置。

[DeviceA] drni system-mac 1-1-1

[DeviceA] drni system-number 1

[DeviceA] drni system-priority 123

# 配置Keepalive报文的目的IP地址和源IP地址。

[DeviceA] drni keepalive ip destination 1.1.1.1 source 1.1.1.2

# 配置端口HundredGigE3/0/5工作在三层模式,并配置IP地址为Keepalive报文的源IP地址。

[DeviceA] interface hundredgige 3/0/5

[DeviceA-HundredGigE3/0/5] port link-mode route

[DeviceA-HundredGigE3/0/5] ip address 1.1.1.2 24

[DeviceA-HundredGigE3/0/5] quit

# 配置Keepalive链路接口为保留接口。

[DeviceA] drni mad exclude interface hundredgige 3/0/5

# 创建二层聚合接口1,并配置该接口为动态聚合模式。

[DeviceA] interface bridge-aggregation 1

[DeviceA-Bridge-Aggregation1] link-aggregation mode dynamic

[DeviceA-Bridge-Aggregation1] quit

# 将端口HundredGigE3/0/2加入到聚合组1中。

[DeviceA] interface hundredgige 3/0/2

[DeviceA-HundredGigE3/0/2] port link-aggregation group 1

[DeviceA-HundredGigE3/0/2] quit

# 将二层聚合接口1配置为IPP口。

[DeviceA] interface bridge-aggregation 1

[DeviceA-Bridge-Aggregation1] port drni intra-portal-port 1

[DeviceA-Bridge-Aggregation1] quit

# 创建VLAN接口2,并配置该接口下的处于可用状态的DRNI虚拟IP地址10.1.1.1以及处于不可用状态的DRNI虚拟IP地址10.1.1.2。

[DeviceA] vlan 2

[DeviceA-vlan2] quit

[DeviceA] interface vlan-interface 2

[DeviceA-Vlan-interface2] port drni virtual-ip 10.1.1.1 24 active virtual-mac 11-1-1

[DeviceA-Vlan-interface2] port drni 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

# 将端口HundredGigE3/0/4加入到聚合组2中。

[DeviceA] interface hundredgige 3/0/4

[DeviceA-HundredGigE3/0/4] port link-aggregation group 2

[DeviceA-HundredGigE3/0/4] quit

# 将二层聚合接口2加入分布式聚合组2中。

[DeviceA] interface bridge-aggregation 2

[DeviceA-Bridge-Aggregation2] port drni 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

# 将端口HundredGigE3/0/3加入到聚合组3中。

[DeviceA] interface hundredgige 3/0/3

[DeviceA-HundredGigE3/0/3] port link-aggregation group 3

[DeviceA-HundredGigE3/0/3] quit

# 将二层聚合接口3加入分布式聚合组3中。

[DeviceA] interface bridge-aggregation 3

[DeviceA-Bridge-Aggregation3] port drni 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

# 配置本端DR接口接入的用户发送RADIUS报文使用的源IP地址为10.1.1.2,对端DR接口接入的用户发送RADIUS报文使用的源IP地址为10.1.1.1。

[DeviceB-radius-radsun] nas-ip drni local 10.1.1.2

[DeviceB-radius-radsun] nas-ip drni 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

¡     配置DRNI。

# 系统配置。

[DeviceB] drni system-mac 1-1-1

[DeviceB] drni system-number 2

[DeviceB] drni system-priority 123

# 配置Keepalive报文的目的IP地址和源IP地址。

[DeviceB] drni keepalive ip destination 1.1.1.2 source 1.1.1.1

# 配置端口HundredGigE3/0/5工作在三层模式,并配置IP地址为Keepalive报文的源IP地址。

[DeviceB] interface hundredgige 3/0/5

[DeviceB-HundredGigE3/0/5] port link-mode route

[DeviceB-HundredGigE3/0/5] ip address 1.1.1.1 24

[DeviceB-HundredGigE3/0/5] quit

# 配置Keepalive链路接口为保留接口。

[DeviceB] drni mad exclude interface hundredgige 3/0/5

# 创建二层聚合接口1,并配置该接口为动态聚合模式。

[DeviceB] interface bridge-aggregation 1

[DeviceB-Bridge-Aggregation1] link-aggregation mode dynamic

[DeviceB-Bridge-Aggregation1] quit

# 将端口HundredGigE3/0/2加入到聚合组1中。

[DeviceB] interface hundredgige 3/0/2

[DeviceB-HundredGigE3/0/2] port link-aggregation group 1

[DeviceB-HundredGigE3/0/2] quit

# 将二层聚合接口1配置为IPP口。

[DeviceB] interface bridge-aggregation 1

[DeviceB-Bridge-Aggregation1] port drni intra-portal-port 1

[DeviceB-Bridge-Aggregation1] quit

# 创建VLAN接口2,并配置该接口下的处于可用状态的DRNI虚拟IP地址10.1.1.2以及处于不可用状态的DRNI虚拟IP地址10.1.1.1。

[DeviceB] vlan 2

[DeviceB-vlan2] quit

[DeviceB] interface vlan-interface 2

[DeviceB-Vlan-interface2] port drni virtual-ip 10.1.1.2 24 active virtual-mac 11-1-2

[DeviceB-Vlan-interface2] port drni 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

# 将端口HundredGigE3/0/4加入到聚合组2中。

[DeviceB] interface hundredgige 3/0/4

[DeviceB-HundredGigE3/0/4] port link-aggregation group 2

[DeviceB-HundredGigE3/0/4] quit

# 将二层聚合接口2加入分布式聚合组2中。

[DeviceB] interface bridge-aggregation 2

[DeviceB-Bridge-Aggregation2] port drni 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

# 将端口HundredGigE3/0/3加入到聚合组3中。

[DeviceB] interface hundredgige 3/0/3

[DeviceB-HundredGigE3/0/3] port link-aggregation group 3

[DeviceB-HundredGigE3/0/3] quit

# 将二层聚合接口3加入分布式聚合组3中。

[DeviceB] interface bridge-aggregation 3

[DeviceB-Bridge-Aggregation3] port drni 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

# 分别将端口HundredGigE3/0/1和HundredGigE3/0/4加入到聚合组1中。

[DeviceC] interface range hundredgige 3/0/1 to hundredgige 3/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

# 分别将端口HundredGigE3/0/1和HundredGigE3/0/4加入到聚合组1中。

[DeviceD] interface range hundredgige 3/0/1 to hundredgige 3/0/4

[DeviceD-if-range] port link-aggregation group 1

[DeviceD-if-range] quit

6. 验证配置

(1)     验证Device A

# 查看Device A上的DRNI简要信息。

[DeviceA] display drni summary

Flags: A -- Aggregate interface down, B -- No peer DR interface configured

       C -- Configuration consistency check failed

 

IPP: BAGG1

IPP state (cause): UP

Keepalive link state (cause): UP

 

                     DR interface information

DR interface  DR 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

   DRNI load sharing mode (criterion)      : Distributed (local)

   DR member's authentication scope        : Local DR interfaces

   DR 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

   OUI value list                          :

 Bridge-Aggregation3 is link-up

   Port mode                               : macAuthentication

   DR member configuration conflict        : Not conflicted

   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

   DR 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

   DR member configuration conflict           : Not conflicted

   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上的DRNI简要信息。

[DeviceB] display drni summary

Flags: A -- Aggregate interface down, B -- No peer DR interface configured

       C -- Configuration consistency check failed

IPP: BAGG1

IPP state (cause): UP

Keepalive link state (cause): UP

                     DR interface information

DR interface  DR 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

   DRNI load sharing mode (criterion)      : Distributed (local)

   DR member's authentication scope        : Local DR interfaces

   DR 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

   OUI value list                          :

 

 Bridge-Aggregation3 is link-up

   Port mode                               : macAuthentication

   DR member configuration conflict        : Not conflicted

   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

   DR 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

   DR member configuration conflict           : Not conflicted

   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上存在相同的用户认证信息。

1.24  端口安全常见故障处理

1.24.1  端口安全模式无法设置

1. 故障现象

无法设置端口的端口安全模式。

2. 故障分析

在当前端口的端口安全模式已配置的情况下,无法直接对端口安全模式进行设置。

3. 处理过程

首先设置端口安全模式为noRestrictions状态,再设置新的端口安全模式。

[Device-HundredGigE3/0/1] undo port-security port-mode

[Device-HundredGigE3/0/1] port-security port-mode autolearn

1.24.2  无法配置安全MAC地址

1. 故障现象

无法配置安全MAC地址。

2. 故障分析

端口安全模式为非autoLearn时,不能对安全MAC地址进行设置。

3. 处理过程

设置端口安全模式为autoLearn状态。

[Device-HundredGigE3/0/1] undo port-security port-mode

[Device-HundredGigE3/0/1] port-security max-mac-count 64

[Device-HundredGigE3/0/1] port-security port-mode autolearn

[Device-HundredGigE3/0/1] port-security mac-address security 1-1-2 vlan 1

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们