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

H3C 中低端以太网交换机 安全典型配置指导-6W100

04-端口安全典型配置指导

本章节下载 04-端口安全典型配置指导  (198.21 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/CE3000/CE3000-EI/Configure/Typical_Configuration_Example/H3C_Security_CG-6W100/201111/733254_30005_0.htm

04-端口安全典型配置指导


1 端口安全典型配置指导

1.1  端口安全简介

端口安全的主要功能是通过定义各种端口安全模式,让设备学习到合法的源MAC地址,以达到相应的网络管理效果。启动了端口安全功能之后,当发现非法报文时,系统将触发相应特性,并按照预先指定的方式进行处理,既方便用户的管理又提高了系统的安全性。

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

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

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

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

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

安全模式

工作机制

NTK/入侵检测

缺省情况

noRestrictions

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

无效

端口控制MAC地址学习

autoLearn

端口可通过手工配置或自动学习MAC地址。这些新的MAC地址被称为安全MAC,并被添加到安全MAC地址表中

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

该模式下,端口禁止学习动态MAC地址

可触发

secure

禁止端口学习MAC地址,只有源MAC地址为端口上的安全MAC地址、手工配置的MAC地址的报文,才能通过该端口

端口采用802.1X认证

userLogin

对接入用户采用基于端口的802.1X认证

此模式下,端口下的第一个802.1X用户认证成功后,其它用户无须认证就可接入

无效

userLoginSecure

对接入用户采用基于MAC地址的802.1X认证

此模式下,端口最多只允许一个802.1X认证用户接入

可触发

userLoginWithOUI

该模式与userLoginSecure模式类似,但端口上除了允许一个802.1X认证用户接入之外,还额外允许一个特殊用户接入,该用户报文的源MAC的OUI与设备上配置的OUI值相符

在用户接入方式为有线的情况下,802.1X报文进行802.1X认证,非802.1X报文直接进行OUI匹配,802.1X认证成功和OUI匹配成功的报文都允许通过端口

userLoginSecureExt

对接入用户采用基于MAC的802.1X认证,且允许端口下有多个802.1X用户

端口采用MAC地址认证

macAddressWithRadius

对接入用户采用MAC地址认证

此模式下,端口允许多个用户接入

可触发

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

macAddressOrUserLoginSecure

端口同时处于userLoginSecure模式和macAddressWithRadius模式

在用户接入方式为有线的情况下,非802.1X报文直接进行MAC地址认证,802.1X报文直接进行802.1X认证

可触发

macAddressElseUserLoginSecure

端口同时处于macAddressWithRadius模式和userLoginSecure模式,但MAC地址认证优先级大于802.1X认证;

非802.1X报文直接进行MAC地址认证。802.1X报文先进行MAC地址认证,如果MAC地址认证失败再进行802.1X认证

macAddressOrUserLoginSecureExt

与macAddressOrUserLoginSecure类似,但允许端口下有多个802.1X和MAC地址认证用户

macAddressElseUserLoginSecureExt

与macAddressElseUserLoginSecure类似,但允许端口下有多个802.1X和MAC地址认证用户

 

1.2  端口安全autolearn模式典型配置指导

1.2.1  应用需求

交换机的以太网端口GigabitEthernet1/0/1与接入用户网络相连,端口GigabitEthernet1/0/2与Internet相连。

要求通过对Switch进行配置,实现对接入用户的控制,具体需求如下:

l              最多允许64个用户通过交换机接入Internet,用户无需进行认证;

l              当用户数量超过64个后,如果有新用户试图通过Switch接入Internet,交换机输出对应的Trap信息,且认为端口GigabitEthernet1/0/1收到了非法报文,将暂时断开连接,30秒后自动恢复端口的开启状态。

图1-1 端口安全autolearn模式配置组网图

 

1.2.2  配置思路

根据组网需求,接入用户无需进行认证,交换机可以通过设置端口安全模式,控制MAC地址的学习,来达到控制接入用户数量的目的。

这里需要配置交换机GigabitEthernet1/0/1端口安全模式为autolearn,将学习到的用户MAC地址添加为安全MAC地址,并最大安全MAC地址数为64,即:再有新的MAC地址接入时,触发入侵检测,交换机输出对应的Trap信息,且GigabitEthernet1/0/1端口被暂时断开连接,30秒后自动恢复端口的开启状态。

1.2.3  适用产品、版本

表1-2 配置适用的产品与软硬件版本关系

产品

软件版本

S7500E系列以太网交换机

Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列

S7600系列以太网交换机

Release 6600系列,Release 6610系列

S5800&S5820X系列以太网交换机

Release 1110,Release 1211

CE3000-32F以太网交换机

Release 1211

S5500-EI系列以太网交换机

Release 2202,Release 2208

S5500-EI-D系列以太网交换机

Release 2208

S5500-SI系列以太网交换机

Release 2202 ,Release 2208

S5120-EI系列以太网交换机

Release 2202,Release 2208

S5120-EI-D系列以太网交换机

Release 1505

S5120-SI系列以太网交换机

Release 1505

S3610&S5510系列以太网交换机

Release 5306,Release 5309

S3500-EA系列以太网交换机

Release 5309

S3100V2系列以太网交换机

Release 5103

E126B以太网交换机

Release 5103

 

1.2.4  配置过程和解释

(1)        配置Switch

# 使能端口安全功能。

<Switch> system-view

[Switch] port-security enable

# 打开入侵检测Trap开关。

[Switch] port-security trap intrusion

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

[Switch] interface GigabitEthernet 1/0/1

[Switch-GigabitEthernet1/0/1] port-security max-mac-count 64

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

[Switch-GigabitEthernet1/0/1] port-security port-mode autolearn

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

[Switch-GigabitEthernet1/0/1] port-security intrusion-mode disableport-temporarily

[Switch-GigabitEthernet1/0/1] quit

[Switch] port-security timer disableport 30

(2)        验证配置结果

上述配置完成后,可以用display命令显示端口安全配置情况,如下:

<Switch> display port-security interface gigabitethernet 1/0/1

 Equipment port-security is enabled

 Intrusion trap is enabled

 Disableport Timeout: 30s

 OUI value:

 

GigabitEthernet1/0/1 is link-up

   Port mode is autoLearn

   NeedToKnow mode is disabled

   Intrusion Protection mode is DisablePortTemporarily

   Max MAC address number is 64

   Stored MAC address number is 0

   Authorization is permitted

可以看到端口的最大安全MAC数为64,端口模式为autoLearn,入侵检测Trap开关打开,入侵保护动作为DisablePortTemporarily,入侵发生后端口禁用时间为30秒。

配置完成后,允许地址学习,学习到的MAC地址数可以用上述命令显示,如学习到5个,那么存储的安全MAC地址数就为5,可以在端口视图下用display this命令查看学习到的MAC地址,如:

<Switch> system-view

[Switch] interface gigabitethernet 1/0/1

[Switch-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 0002-0000-0015 vlan 1

 port-security mac-address security 0002-0000-0014 vlan 1

 port-security mac-address security 0002-0000-0013 vlan 1

 port-security mac-address security 0002-0000-0012 vlan 1

 port-security mac-address security 0002-0000-0011 vlan 1

#

当学习到的MAC地址数达到64后,用命令display port-security interface可以看到端口模式变为secure,再有新的MAC地址到达将触发入侵保护,Trap信息如下:

#May  2 03:15:55:871 2000 Switch PORTSEC/1/VIOLATION:Traph3cSecureViolation

 A intrusion occurs!

 IfIndex: 9437207

 Port: 9437207

 MAC Addr: 0.2.0.0.0.21

 VLAN ID: 1

 IfAdminStatus: 1

并且可以通过下述命令看到端口安全将此端口关闭:

<Switch> display interface gigabitethernet 1/0/1

 GigabitEthernet1/0/1 current state:  Port Security Disabled

 IP Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 000f-cb00-5558

 Description: GigabitEthernet1/0/1 Interface

 ......

30秒后,端口状态恢复:

[Switch-GigabitEthernet1/0/1] display interface gigabitethernet 1/0/1

 GigabitEthernet1/0/1 current state: UP

 IP Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 000f-cb00-5558

 Description: GigabitEthernet1/0/1 Interface

 ......

此时,如手动删除几条安全MAC地址后,端口安全的状态重新恢复为autoLearn,可以继续学习MAC地址。

1.2.5  完整配置

#

 port-security enable

 port-security trap intrusion

 port-security timer disableport 30

#

interface GigabitEthernet1/0/1

 port-security max-mac-count 64

 port-security port-mode autolearn

 port-security intrusion-mode disableport-temporarily

#

1.2.6  配置注意事项

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

l              端口安全模式的配置与端口加入聚合组互斥。

l              当多个用户通过认证时,端口下所允许的最大用户数根据不同的端口安全模式,取最大安全MAC地址数与相应模式下允许认证用户数的最小值。

l              端口上有用户在线的情况下,端口安全功能无法关闭。

1.3  端口安全userLoginWithOUI模式典型配置指导

1.3.1  应用需求

用户Host(已安装802.1X客户端软件)和打印机Printer通过端口GigabitEthernet1/0/1连接到交换机Switch上,交换机通过RADIUS服务器对用户进行身份认证,如果认证成功,用户被授权允许访问Internet资源。

要求通过对Switch进行配置,实现对接入用户的控制,具体需求如下:

l              最多允许一个802.1X用户通过该端口接入Internet;

l              允许打印机通过该端口GigabitEthernet1/0/1与Internet资源正常连接;

l              当有非法用户接入时,触发入侵检测,将非法报文丢弃(不对端口进行关闭)。

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

 

1.3.2  配置思路

根据组网需求,接入用户中既有安装了802.1X客户端的Host,又有打印机Printer。交换机可以通过设置端口安全模式,控制用户的接入。

l              配置交换机GigabitEthernet1/0/1端口安全模式为userLoginWithOUI,即:该端口最多只允许一个802.1X认证用户接入,并允许一个指定OUI的源MAC地址的报文认证通过。并为userLoginWithOUI端口安全模式配置5个OUI值(对应不同厂商的打印机MAC地址的OUI)。

l              配置端口安全的入侵检测功能:当GigabitEthernet1/0/1端口接收到非法报文后,触发入侵检测,将非法报文丢弃,同时将其源MAC地址加入阻塞MAC地址列表中。

l              在交换机上为认证用户添加认证域和RADIUS方案,并配置IP地址为192.168.1.1的RADIUS服务器作为主认证/备份计费服务器,IP地址为192.168.1.2的RADIUS服务器作为备份认证/主计费服务器。认证共享密钥为name,计费共享密钥为money。

1.3.3  适用产品、版本

表1-3 配置适用的产品与软硬件版本关系

产品

软件版本

S7500E系列以太网交换机

Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列

S7600系列以太网交换机

Release 6600系列,Release 6610系列

S5800&S5820X系列以太网交换机

Release 1110,Release 1211

CE3000-32F以太网交换机

Release 1211

S5500-EI系列以太网交换机

Release 2202,Release 2208

S5500-EI-D系列以太网交换机

Release 2208

S5500-SI系列以太网交换机

Release 2202 ,Release 2208

S5120-EI系列以太网交换机

Release 2202,Release 2208

S5120-EI-D系列以太网交换机

Release 1505

S5120-SI系列以太网交换机

Release 1505

S3610&S5510系列以太网交换机

Release 5306,Release 5309

S3500-EA系列以太网交换机

Release 5309

S3100V2系列以太网交换机

Release 5103

E126B以太网交换机

Release 5103

 

1.3.4  配置过程和解释

接入用户和RADIUS服务器上的配置略。

 

(1)        配置Switch

l              配置RADIUS方案

# 创建名为radsun的RADIUS方案。

<Switch> system-view

[Switch] radius scheme radsun

# 设置主认证RADIUS服务器的IP地址为192.168.1.1,主计费RADIUS服务器的IP地址为192.168.1.2。

[Switch-radius-radsun] primary authentication 192.168.1.1

[Switch-radius-radsun] primary accounting 192.168.1.2

# 设置从认证RADIUS服务器的IP地址为192.168.1.2,从计费RADIUS服务器的IP地址为192.168.1.1。

[Switch-radius-radsun] secondary authentication 192.168.1.2

[Switch-radius-radsun] secondary accounting 192.168.1.1

# 设置与认证RADIUS服务器交互报文时的加密密码为name。

[Switch-radius-radsun] key authentication name

# 设置与计费RADIUS服务器交互报文时的加密密码为money。

[Switch-radius-radsun] key accounting money

# 设置RADIUS服务器应答超时时间为5秒,RADIUS报文的超时重传次数的最大值为5。

[Switch-radius-radsun] timer response-timeout 5

[Switch-radius-radsun] retry 5

# 设置向RADIUS服务器发送实时计费报文的时间间隔为15分钟。

[Switch-radius-radsun] timer realtime-accounting 15

# 设置将去除域名的用户名发送给RADIUS服务器。

[Switch-radius-radsun] user-name-format without-domain

[Switch-radius-radsun] quit

# 创建名为sun的ISP域,并进入其视图。

[Switch] domain sun

# 指定名为radsun的RADIUS方案为该域用户的缺省RADIUS方案。

[Switch-isp-sun] authentication default radius-scheme radsun

[Switch-isp-sun] authorization default radius-scheme radsun

[Switch-isp-sun] accounting default radius-scheme radsun

# 设置该ISP域最多可容纳30个用户。

[Switch-isp-sun] access-limit enable 30

[Switch-isp-sun] quit

l              配置802.1X

# 配置802.1X的认证方式为CHAP。(该配置可选,缺省情况下802.1X的认证方式为CHAP)

[Switch] dot1x authentication-method chap

l              配置端口安全特性

# 使能端口安全功能。

[Switch] port-security enable

# 添加5个OUI值。

[Switch] port-security oui 1234-0100-1111 index 1

[Switch] port-security oui 1234-0200-1111 index 2

[Switch] port-security oui 1234-0300-1111 index 3

[Switch] port-security oui 1234-0400-1111 index 4

[Switch] port-security oui 1234-0500-1111 index 5

[Switch] interface GigabitEthernet 1/0/1

# 设置端口安全模式为userLoginWithOUI

[Switch-GigabitEthernet1/0/1] port-security port-mode userlogin-withoui

[Switch-GigabitEthernet1/0/1] quit

(2)        验证配置结果

查看名为radsun的RADIUS方案的配置信息:

[Switch] display radius scheme radsun

SchemeName  = radsun

  Index = 0                           Type = standard

  Primary Auth IP  = 192.168.1.1      Port = 1812   State = active

  Primary Acct IP  = 192.168.1.2      Port = 1813   State = active

  Second  Auth IP  = 192.168.1.2      Port = 1812   State = active

  Second  Acct IP  = 192.168.1.1      Port = 1813   State = active

  Auth Server Encryption Key = name

  Acct Server Encryption Key = money

  Accounting-On packet disable, send times = 5 , interval = 3s

  Interval for timeout(second)                            = 5

  Retransmission times for timeout                        = 5

  Interval for realtime accounting(minute)                = 15

  Retransmission times of realtime-accounting packet      = 5

  Retransmission times of stop-accounting packet          = 500

  Quiet-interval(min)                                     = 5

  Username format                                         = without-domain

  Data flow unit                                          = Byte

  Packet unit                                             = one

查看名为sun的ISP域的配置信息:

<Switch> display domain sun

   Domain = sun

   State = Active

   Access-limit = 30

   Accounting method = Required

   Default authentication scheme      : radius=radsun

   Default authorization scheme       : local

   Default accounting scheme          : local

   Domain User Template:

   Idle-cut = Disable

   Self-service = Disable

查看端口安全的配置信息:

<Switch> display port-security interface gigabitethernet 1/0/1

 Equipment port-security is enabled

 Trap is disabled

 Disableport Timeout: 20s

 OUI value:

   Index is 1,  OUI value is 123401

   Index is 2,  OUI value is 123402

   Index is 3,  OUI value is 123403

   Index is 4,  OUI value is 123404

   Index is 5,  OUI value is 123405

 

 GigabitEthernet1/0/1 is link-up

   Port mode is userLoginWithOUI

   NeedToKnow mode is disabled

   Intrusion Protection mode is NoAction

   Max MAC address number is not configured

   Stored MAC address number is 0

   Authorization is permitted

配置完成后,如果有802.1X用户上线,则可以看到存储的安全MAC地址数为1。还可以通过下述命令查看802.1X用户的情况:

<Switch> display dot1x interface gigabitethernet 1/0/1

 Equipment 802.1X protocol is enabled

 CHAP authentication is enabled

 

Configuration: Transmit Period   30 s,  Handshake Period       15 s

                Quiet Period      60 s,  Quiet Period Timer is disabled

                Supp Timeout      30 s,  Server Timeout        100 s

                The maximal retransmitting times    2

 

Total maximum 802.1X user resource number is 1024 per slot

 Total current used 802.1X resource number is 1

 

GigabitEthernet1/0/1  is link-up

   802.1X protocol is enabled

   Handshake is enabled

   The port is an authenticator

   Authentication Mode is Auto

   Port Control Type is Mac-based

   Guest VLAN: 0

   Max number of on-line users is 256

 

   EAPOL Packet: Tx 16331, Rx 102

   Sent EAP Request/Identity Packets : 16316

        EAP Request/Challenge Packets: 6

        EAP Success Packets: 4, Fail Packets: 5

   Received EAPOL Start Packets : 6

            EAPOL LogOff Packets: 2

            EAP Response/Identity Packets : 80

            EAP Response/Challenge Packets: 6

            Error Packets: 0

 1. Authenticated user : MAC address: 0002-0000-0011

 

   Controlled User(s) amount to 1

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

<Switch> display mac-address interface gigabitethernet 1/0/1

MAC ADDR        VLAN ID   STATE          PORT INDEX               AGING TIME(s)

1234-0300-0011  1         Learned        GigabitEthernet1/0/1     AGING

 

  ---  1 mac address(es) found  ---

1.3.5  完整配置

#

 port-security enable

 port-security oui 1234-0100-0000 index 1

 port-security oui 1234-0200-0000 index 2

 port-security oui 1234-0300-0000 index 3

 port-security oui 1234-0400-0000 index 4

 port-security oui 1234-0500-0000 index 5

#

radius scheme radsun

 primary authentication 192.168.1.1

 primary accounting 192.168.1.2

 secondary authentication 192.168.1.2

 secondary accounting 192.168.1.1

 key authentication name

 key accounting money

 timer realtime-accounting 15

 timer response-timeout 5

 user-name-format without-domain

 retry 5

#

domain sun

 authentication default radius-scheme radsun

 access-limit enable 30

#

interface GigabitEthernet1/0/1

 port-security port-mode userlogin-withoui

#

1.3.6  配置注意事项

允许通过认证的用户OUI值可以配置多条。

1.4  端口安全macAddressElseUserLoginSecure模式典型配置指导

1.4.1  应用需求

Host通过端口GigabitEthernet1/0/1连接到交换机上,交换机通过RADIUS服务器对客户端进行身份认证。如果认证成功,客户端被授权允许访问Internet资源。

要求通过对Switch进行配置,实现对接入用户的控制,具体需求如下:

l              端口GigabitEthernet1/0/1下接入的用户可以使用802.1X认证或MAC地址认证,但MAC地址认证优先级大于802.1X认证;

l              802.1X认证用户数量限制为1个;但可以有多个MAC地址认证用户上线;

l              MAC地址认证设置用户名格式为自定义用户名和密码的形式,上线的MAC地址认证用户和802.1X认证用户总和不能超过64个;

l              为防止报文发往未知目的MAC地址,启动NeedToKnow特性。

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

 

1.4.2  配置思路

l              根据组网需求,交换机GE1/0/1端口所连接的用户需要使用不同的认证方式进行认证,因此开启端口安全特性,并配置安全模式为macAddressElseUserLoginSecure,即:对于非802.1X报文直接进行MAC地址认证,对于802.1X报文先进行MAC地址认证,如果MAC地址认证失败再进行802.1X认证。

l              通过端口安全的入侵检测功能,限制认证端口上出方向的报文转发。配置NeedToKnow功能为ntkonly模式,即仅允许目的MAC地址为已通过认证的MAC地址的单播报文通过。

l              为认证用户添加认证域和RADIUS方案。

1.4.3  适用产品、版本

表1-4 配置适用的产品与软硬件版本关系

产品

软件版本

S7500E系列以太网交换机

Release 6100系列,Release 6300系列,Release 6600系列,Release 6610系列

S7600系列以太网交换机

Release 6600系列,Release 6610系列

S5800&S5820X系列以太网交换机

Release 1110,Release 1211

CE3000-32F以太网交换机

Release 1211

S5500-EI系列以太网交换机

Release 2202,Release 2208

S5500-EI-D系列以太网交换机

Release 2208

S5500-SI系列以太网交换机

Release 2202 ,Release 2208

S5120-EI系列以太网交换机

Release 2202,Release 2208

S5120-EI-D系列以太网交换机

Release 1505

S5120-SI系列以太网交换机

Release 1505

S3610&S5510系列以太网交换机

Release 5306,Release 5309

S3500-EA系列以太网交换机

Release 5309

S3100V2系列以太网交换机

Release 5103

E126B以太网交换机

Release 5103

 

1.4.4  配置过程和解释

接入用户和RADIUS服务器上的配置略。

 

(1)        配置Switch

l              配置RADIUS协议

# 创建名为radsun的RADIUS方案。

<Switch> system-view

[Switch] radius scheme radsun

# 设置主认证RADIUS服务器的IP地址为192.168.1.1,主计费RADIUS服务器的IP地址为192.168.1.2。

[Switch-radius-radsun] primary authentication 192.168.1.1

[Switch-radius-radsun] primary accounting 192.168.1.2

# 设置从认证RADIUS服务器的IP地址为192.168.1.2,从计费RADIUS服务器的IP地址为192.168.1.1。

[Switch-radius-radsun] secondary authentication 192.168.1.2

[Switch-radius-radsun] secondary accounting 192.168.1.1

# 设置与认证RADIUS服务器交互报文时的加密密码为name。

[Switch-radius-radsun] key authentication name

# 设置与计费RADIUS服务器交互报文时的加密密码为money。

[Switch-radius-radsun] key accounting money

# 设置RADIUS服务器应答超时时间为5秒,RADIUS报文的超时重传次数的最大值为5。

[Switch-radius-radsun] timer response-timeout 5

[Switch-radius-radsun] retry 5

# 设置向RADIUS服务器发送实时计费报文的时间间隔为15分钟。

[Switch-radius-radsun] timer realtime-accounting 15

# 设置将去除域名的用户名发送给RADIUS服务器。

[Switch-radius-radsun] user-name-format without-domain

[Switch-radius-radsun] quit

# 创建名为sun的ISP域,并进入其视图。

[Switch] domain sun

# 指定名为radsun的RADIUS方案为该域用户的缺省RADIUS方案。

[Switch-isp-sun] authentication default radius-scheme radsun

[Switch-isp-sun] authorization default radius-scheme radsun

[Switch-isp-sun] accounting default radius-scheme radsun

[Switch-isp-sun] quit

l              配置端口安全特性

# 使能端口安全功能。

[Switch] port-security enable

# 配置802.1X的认证方式为CHAP。(该配置可选,缺省情况下802.1X的认证方式为CHAP)

[Switch] dot1x authentication-method chap

# 配置MAC地址认证用户所使用的ISP域。

[Switch] mac-authentication domain sun

# 配置MAC认证的用户名为aaa,密码为123456。

[Switch] mac-authentication user-name-format fixed account aaa password simple 123456

[Switch] interface gigabitethernet 1/0/1

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

[Switch-GigabitEthernet1/0/1] port-security max-mac-count 64

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

[Switch-GigabitEthernet1/0/1] port-security port-mode mac-else-userlogin-secure

# 设置端口NeedToKnow模式为ntkonly。

[Switch-GigabitEthernet1/0/1] port-security ntk-mode ntkonly

(2)        验证配置结果

查看端口安全的配置信息:

<Switch> display port-security interface gigabitethernet 1/0/1

 Equipment port-security is enabled

 Trap is disabled

 Disableport Timeout: 20s

 OUI value:

 

 GigabitEthernet1/0/1 is link-up

   Port mode is macAddressElseUserLoginSecure

   NeedToKnow mode is NeedToKnowOnly

   Intrusion Protection mode is NoAction

   Max MAC address number is 64

   Stored MAC address number is 0

   Authorization is permitted

查看MAC地址认证情况:

<Switch> display mac-authentication interface gigabitethernet 1/0/1

MAC address authentication is enabled.

 User name format is fixed account

 Fixed username:aaa

 Fixed password:123456

          Offline detect period is 300s

          Quiet period is 60s

          Server response timeout value is 100s

          The max allowed user number is 1024 per slot

          Current user number amounts to 3

          Current domain is sun

 

Silent MAC User info:

          MAC Addr         From Port                    Port Index

 

GigabitEthernet1/0/1 is link-up

  MAC address authentication is enabled

  Authenticate success: 3, failed: 1

  Current online user number is 3

    MAC Addr         Authenticate State           Auth Index

    1234-0300-0011   MAC_AUTHENTICATOR_SUCCESS     13

    1234-0300-0012   MAC_AUTHENTICATOR_SUCCESS     14

    1234-0300-0013   MAC_AUTHENTICATOR_SUCCESS     15

查看802.1X认证情况:

<Switch> display dot1x interface gigabitethernet 1/0/1

 Equipment 802.1X protocol is enabled

 CHAP authentication is enabled

 Configuration: Transmit Period   30 s,  Handshake Period       15 s

                Quiet Period      60 s,  Quiet Period Timer is disabled

                Supp Timeout      30 s,  Server Timeout        100 s

                The maximal retransmitting times    2

 EAD quick deploy configuration:

                EAD timeout:   30 m

 The maximum 802.1X user resource number is 1024 per slot

 Total current used 802.1X resource number is 1

 GigabitEthernet1/0/1  is link-up

   802.1X protocol is enabled

   Handshake is enabled

   The port is an authenticator

   Authentication Mode is Auto

   Port Control Type is Mac-based

   802.1X Multicast-trigger is enabled

   Guest VLAN: 0

   Max number of on-line users is 256

   EAPOL Packet: Tx 16331, Rx 102

   Sent EAP Request/Identity Packets : 16316

        EAP Request/Challenge Packets: 6

        EAP Success Packets: 4, Fail Packets: 5

   Received EAPOL Start Packets : 6

            EAPOL LogOff Packets: 2

            EAP Response/Identity Packets : 80

            EAP Response/Challenge Packets: 6

            Error Packets: 0

 1. Authenticated user : MAC address: 0002-0000-0011

   Controlled User(s) amount to 1             

此外,因为设置了NeedToKnow特性,目的MAC地址未知、广播和多播报文都被丢弃。

1.4.5  完整配置

#

 port-security enable

#

 mac-authentication domain sun

 mac-authentication user-name-format fixed account aaa password simple 123456

#

radius scheme radsun

 primary authentication 192.168.1.1

 primary accounting 192.168.1.2

 secondary authentication 192.168.1.2

 secondary accounting 192.168.1.1

 key authentication name

 key accounting money

 timer realtime-accounting 15

 timer response-timeout 5

 user-name-format without-domain

 retry 5

#

domain sun

 authentication default radius-scheme radsun

#

interface GigabitEthernet1/0/1

 port-security max-mac-count 64

 port-security port-mode mac-else-userlogin-secure

 port-security ntk-mode ntkonly

#

1.4.6  配置注意事项

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

 

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

新华三官网
联系我们