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

H3C低端以太网交换机 典型配置指导(V1.01)

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

本章节下载  (204.68 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/E/E328[E352]/Configure/Typical_Configuration_Example/E328[E352]_Typical_Configuration_Example(V1.01)/200808/614429_30005_0.htm

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


第1章  端口安全典型配置指导

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

在autolearn安全模式下,端口学习到的MAC地址会转变为Security MAC地址。当端口下的Security MAC地址数超过port-security max-mac-count命令配置的数目后,端口模式会自动转变为secure模式。之后,该端口不会再添加新的Security MAC,只有源MAC为Security MAC或已配置的动态MAC的报文,才能通过该端口。

1.1.1  组网图

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

1.1.2  应用要求

在交换机的端口Ethernet1/0/1上对接入用户做如下的限制:

l              允许最多80个用户自由接入,不进行认证,将学习到的用户MAC地址添加为Security MAC地址;

l              为确保用户Host能够接入,将该用户的MAC地址0001-0002-0003作为Security MAC地址,添加到VLAN 1中;

l              当Security MAC地址数量达到80后,停止学习;当再有新的MAC地址接入时,触发Intrusion Protection特性,并将此端口关闭30秒。

1.1.3  适用产品、版本

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

产品

软件版本

硬件版本

S5600系列

Release 1510、Release 1602软件版本

全系列硬件版本

S5100-SI/EI系列

Release2200、Release 2201软件版本

全系列硬件版本

S3600-SI/EI系列

Release 1510、Release 1602软件版本

全系列硬件版本

S3100-EI系列

Release 2104、Release 2107软件版本

全系列硬件版本

S3100-C-SI系列

S3100-T-SI系列

Release 2102、Release 2107软件版本

全系列硬件版本

S3100-TP-SI系列

Release 2102、Release 2107软件版本

全系列硬件版本

(除S3100-52TP-SI)

S3100-52TP-SI

Release 2106、Release 2107软件版本

S3100-52TP-SI

S3100-52P

Release 1602软件版本

S3100-52P

S2126-EI

Release 2102、Release 2106、Release 2107软件版本

S2126-EI

S2000-EA系列

Release 2107软件版本

全系列硬件版本

E352&E328

Release 1510、Release 1602软件版本

E352&E328

E152

Release 1602软件版本

E152

E126

Release 2102、Release 2107软件版本

E126

E126A

Release 2104、Release 2107软件版本

E126A

 

1.1.4  配置过程和解释

# 进入系统视图。

<Switch> system-view

# 启动端口安全功能。

[Switch] port-security enable

# 进入以太网Ethernet1/0/1端口视图。

[Switch] interface Ethernet1/0/1

# 设置端口允许接入的最大MAC地址数为80。

[Switch-Ethernet1/0/1] port-security max-mac-count 80

# 配置端口的安全模式为autolearn。

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

# 将Host 的MAC地址0001-0002-0003作为Security MAC添加到VLAN 1中。

[Switch-Ethernet1/0/1] mac-address security 0001-0002-0003 vlan 1

# 设置Intrusion Protection特性被触发后,暂时关闭该端口,关闭时间为30秒。

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

[Switch-Ethernet1/0/1] quit

[Switch] port-security timer disableport 30

1.1.5  完整配置

#

 port-security enable

 port-security timer disableport 30

#

interface Ethernet1/0/1

 port-security max-mac-count 80

 port-security port-mode autolearn

 port-security intrusion-mode disableport-temporarily

 mac-address security 0001-0002-0003 vlan 1

#

1.1.6  配置注意事项

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

l              在已经配置了安全模式的端口下,将不能再进行最大MAC地址学习个数、镜像反射端口、Fabric端口和端口汇聚的配置。

1.2  端口安全mac-authentication模式典型配置指导

在mac-authentication安全模式下,交换机将在启动端口安全的端口上对接入用户采用MAC地址认证。

1.2.1  组网图

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

1.2.2  组网需求

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

交换机的管理者希望对接入用户的端口Ethernet1/0/1做如下限制:

l              对接入用户进行MAC地址认证;

l              所有用户都属于域:example.com,MAC地址认证时使用用户PC的MAC地址作为用户名和密码。

l              对未通过MAC认证的报文,触发Intrusion Protection特性,过滤源地址是此MAC地址的报文,保证该端口的安全性。

1.2.3  适用产品、版本

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

产品

软件版本

硬件版本

S5600系列

Release 1510、Release 1602软件版本

全系列硬件版本

S5100-SI/EI系列

Release2200、Release 2201软件版本

全系列硬件版本

S3600-SI/EI系列

Release 1510、Release 1602软件版本

全系列硬件版本

S3100-EI系列

Release 2104、Release 2107软件版本

全系列硬件版本

S3100-C-SI系列

S3100-T-SI系列

Release 2102、Release 2107软件版本

全系列硬件版本

S3100-TP-SI系列

Release 2102、Release 2107软件版本

全系列硬件版本

(除S3100-52TP-SI)

S3100-52TP-SI

Release 2106、Release 2107软件版本

S3100-52TP-SI

S3100-52P

Release 1602软件版本

S3100-52P

S2126-EI

Release 2102、Release 2106、Release 2107软件版本

S2126-EI

S2000-EA系列

Release 2107软件版本

全系列硬件版本

E352&E328

Release 1510、Release 1602软件版本

E352&E328

E152

Release 1602软件版本

E152

E126

Release 2102、Release 2107软件版本

E126

E126A

Release 2104、Release 2107软件版本

E126A

 

1.2.4  配置过程和解释

&  说明:

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

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

 

l              配置RADIUS协议

# 创建名为radius1的RADIUS方案。

<Switch> system-view

[Switch] radius scheme radius1

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

[Switch-radius-radius1] primary authentication 192.168.1.3

[Switch-radius-radius1] primary accounting 192.168.1.2

# 设置备份认证RADIUS服务器的IP地址为192.168.1.2,备份计费RADIUS服务器的IP地址为192.168.1.3。

[Switch-radius-radius1] secondary authentication 192.168.1.2

[Switch-radius-radius1] secondary accounting 192.168.1.3

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

[Switch-radius-radius1] key authentication name

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

[Switch-radius-radius1] key accounting name

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

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

[Switch-radius-radius1] quit

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

[Switch] domain example.com

# 指定radius1为该域用户的RADIUS方案。

[Switch-isp-example.com] scheme radius-scheme radius1

[Switch-isp-example.com] quit

# 配置域example.com为缺省用户域。

[Switch] domain default enable example.com

# 配置采用MAC地址用户名进行认证,并指定不使用带有分隔符的小写形式的MAC地址作为验证的用户名和密码。

[Switch] mac-authentication authmode usernameasmacaddress usernameformat without-hyphen

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

[Switch] mac-authentication domain example.com

# 启动端口安全功能

[Switch] port-security enable

# 配置端口安全模式为mac-authentication

[Switch] interface Ethernet 1/0/1

[Switch-Ethernet1/0/1] port-security port-mode mac-authentication

# 设置Intrusion Protection特性被触发后,丢弃源MAC地址是此MAC地址的报文。

[Switch-Ethernet1/0/1] port-security intrusion-mode blockmac

1.2.5  完整配置

#

 domain default enable example.com

#

 port-security enable

#

 MAC-authentication domain example.com

#

radius scheme radius1

 server-type standard

 primary authentication 192.168.1.3

 primary accounting 192.168.1.2

 secondary authentication 192.168.1.2

 secondary accounting 192.168.1.3

 key authentication name

 key accounting name

 user-name-format without-domain

#

domain example.com

 scheme radius-scheme radius1

#

interface Ethernet1/0/1

 port-security port-mode mac-authentication

 port-security intrusion-mode blockmac

1.2.6  配置注意事项

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

l              在已经配置了安全模式的端口下,将不能再进行最大MAC地址学习个数、镜像反射端口、Fabric端口和端口汇聚的配置。

1.3  端口安全userlogin-withoui模式典型配置指导

在userlogin-withoui模式下,交换机对接入用户采用基于MAC的802.1x认证,认证成功后端口开启,但也只允许认证成功的用户报文通过。同时,端口还允许一个OUI(Organizationally Unique Identifier 是一个全球唯一的标识符,是MAC地址的前24位)地址的报文通过。

1.3.1  组网图

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

1.3.2  组网需求

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

交换机的管理者希望对接入用户的端口Ethernet1/0/1做如下限制:

l              允许一个802.1x用户上线;

l              设置2个OUI值,允许端口上有一个与OUI值匹配的MAC地址用户通过;

l              打开指定Trap信息开关,使管理员能够对802.1x认证用户的行为进行监控。

1.3.3  适用产品、版本

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

产品

软件版本

硬件版本

S5600系列

Release 1510、Release 1602软件版本

全系列硬件版本

S5100-SI/EI系列

Release2200、Release 2201软件版本

全系列硬件版本

S3600-SI/EI系列

Release 1510、Release 1602软件版本

全系列硬件版本

S3100-EI系列

Release 2104、Release 2107软件版本

全系列硬件版本

S3100-C-SI系列

S3100-T-SI系列

Release 2102、Release 2107软件版本

全系列硬件版本

S3100-TP-SI系列

Release 2102、Release 2107软件版本

全系列硬件版本

(除S3100-52TP-SI)

S3100-52TP-SI

Release 2106、Release 2107软件版本

S3100-52TP-SI

S3100-52P

Release 1602软件版本

S3100-52P

S2126-EI

Release 2102、Release 2106、Release 2107软件版本

S2126-EI

S2000-EA系列

Release 2107软件版本

全系列硬件版本

E352&E328

Release 1510、Release 1602软件版本

E352&E328

E152

Release 1602软件版本

E152

E126

Release 2102、Release 2107软件版本

E126

E126A

Release 2104、Release 2107软件版本

E126A

 

1.3.4  配置过程和解释

&  说明:

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

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

 

l              配置RADIUS协议

# 创建名为radius1的RADIUS方案。

<Switch> system-view

[Switch] radius scheme radius1

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

[Switch-radius-radius1] primary authentication 192.168.1.3

[Switch-radius-radius1] primary accounting 192.168.1.2

# 设置备份认证RADIUS服务器的IP地址为192.168.1.2,备份计费RADIUS服务器的IP地址为192.168.1.3。

[Switch-radius-radius1] secondary authentication 192.168.1.2

[Switch-radius-radius1] secondary accounting 192.168.1.3

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

[Switch-radius-radius1] key authentication name

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

[Switch-radius-radius1] key accounting name

# 设置系统向RADIUS服务器重发报文的时间间隔与次数。

[Switch-radius-radius1] timer 5

[Switch-radius-radius1] retry 5

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

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

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

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

[Switch-radius-radius1] quit

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

[Switch] domain example.com

# 指定radius1为该域用户的RADIUS方案,若RADIUS服务器无效,则使用本地认证方案。

[Switch-isp-example.com] scheme radius-scheme radius1 local

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

[Switch-isp-example.com] access-limit enable 30

# 启动闲置切断功能并设置相关参数。

[Switch-isp-example.com] idle-cut enable 20 2000

[Switch-isp-example.com] quit

# 配置域example.com为缺省用户域。

[Switch] domain default enable example.com

# 添加本地接入用户。

[Switch] local-user localuser

[Switch-luser-localuser] service-type lan-access

[Switch-luser-localuser] password simple localpass

l              配置端口安全特性

# 启动端口安全功能。

[Switch] port-security enable

# 添加2个OUI值。

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

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

# 设置端口安全模式为userlogin-withoui

[Switch] interface Ethernet 1/0/1

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

[Switch-Ethernet1/0/1] quit

# 打开指定Trap信息开关

[Switch] port-security trap dot1xlogfailure

[Switch] port-security trap dot1xlogon

[Switch] port-security trap dot1xlogoff

1.3.5  完整配置

#

 domain default enable example.com

#

 port-security enable

 port-security trap dot1xlogon

 port-security trap dot1xlogoff

 port-security trap dot1xlogfailure

 port-security oui 1234-0100-0000 index 1

 port-security oui 1234-0200-0000 index 2

#

radius scheme radius1

 server-type standard

 primary authentication 192.168.1.3

 primary accounting 192.168.1.2

 secondary authentication 192.168.1.2

 secondary accounting 192.168.1.3

 key authentication name

 key accounting name

 timer realtime-accounting 15

 timer response-timeout 5

 retry 5

 user-name-format without-domain

#

domain example.com

 scheme radius-scheme radius1 local

 access-limit enable 30

 idle-cut enable 20 2000

#

local-user localuser

 password simple localpass

 service-type lan-access

#

interface Ethernet1/0/1

 port-security port-mode userlogin-withoui

#

1.3.6  配置注意事项

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

l              在已经配置了安全模式的端口下,将不能再进行最大MAC地址学习个数、镜像反射端口、Fabric端口和端口汇聚的配置。

1.4  端口安全mac-else-userlogin-secure-ext模式典型配置指导

在mac-else-userlogin-secure-ext安全模式下,交换机对接入用户先进行MAC地址认证,如果成功则表明认证通过,如果失败再进行802.1x认证。同时,端口下允许经过认证的用户可以有多个。

1.4.1  组网图

图1-4 端口安全mac-else-userlogin-secure-ext模式组网图

1.4.2  组网需求

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

交换机的管理者希望对接入用户的端口Ethernet1/0/1做如下的限制:

l              对认证用户先进行MAC地址认证,如果MAC地址认证失败,认证用户还可以再进行802.1x认证;

l              允许最多64个802.1x认证用户上线,通过认证的802.1x用户和MAC地址用户最多不能超过200个;

l              所有用户都属于域:example.com,MAC地址认证时使用用户PC的MAC地址作为用户名和密码。

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

1.4.3  适用产品、版本

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

产品

软件版本

硬件版本

S5600系列

Release 1510、Release 1602软件版本

全系列硬件版本

S5100-SI/EI系列

Release2200、Release 2201软件版本

全系列硬件版本

S3600-SI/EI系列

Release 1510、Release 1602软件版本

全系列硬件版本

S3100-52P

Release 1602软件版本

S3100-52P

E352&E328

Release 1510、Release 1602软件版本

E352&E328

E152

Release 1602软件版本

E152

 

1.4.4  配置过程和解释

&  说明:

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

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

 

l              配置RADIUS协议

# 创建名为radius1的RADIUS方案。

<Switch> system-view

[Switch] radius scheme radius1

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

[Switch-radius-radius1] primary authentication 192.168.1.3

[Switch-radius-radius1] primary accounting 192.168.1.2

# 设置备份认证RADIUS服务器的IP地址为192.168.1.2,备份计费RADIUS服务器的IP地址为192.168.1.3。

[Switch-radius-radius1] secondary authentication 192.168.1.2

[Switch-radius-radius1] secondary accounting 192.168.1.3

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

[Switch-radius-radius1] key authentication name

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

[Switch-radius-radius1] key accounting name

# 设置系统向RADIUS服务器重发报文的时间间隔与次数。

[Switch-radius-radius1] timer 5

[Switch-radius-radius1] retry 5

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

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

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

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

[Switch-radius-radius1] quit

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

[Switch] domain example.com

# 指定radius1为该域用户的RADIUS方案。

[Switch-isp-example.com] scheme radius-scheme radius1

# 启动闲置切断功能并设置相关参数。

[Switch-isp-example.com] idle-cut enable 20 2000

[Switch-isp-example.com] quit

# 配置域example.com为缺省用户域。

[Switch] domain default enable example.com

# 配置同时接入802.1x用户数量的最大值

[Switch] dot1x max-user 64

# 配置采用MAC地址用户名进行认证,并指定不使用带有分隔符的小写形式的MAC地址作为验证的用户名和密码。

[Switch] mac-authentication authmode usernameasmacaddress usernameformat without-hyphen

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

[Switch] mac-authentication domain example.com

# 启动端口安全功能。

[Switch] port-security enable

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

[Switch] interface Ethernet 1/0/1

[Switch-Ethernet1/0/1] port-security max-mac-count 200

# 设置端口安全模式为mac-else-userlogin-secure-ext。

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

# 设置端口NeedToKnow模式为ntkonly。

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

完整配置

#

 domain default enable example.com

#

 port-security enable

#

 MAC-authentication domain example.com

#

radius scheme radius1

 server-type standard

 primary authentication 192.168.1.3

 primary accounting 192.168.1.2

 secondary authentication 192.168.1.2

 secondary accounting 192.168.1.3

 key authentication name

 key accounting name

 timer realtime-accounting 15

 timer response-timeout 5

 retry 5

 user-name-format without-domain

#

domain example.com

 scheme radius-scheme radius1

 idle-cut enable 20 2000

#

interface Ethernet1/0/1

 port-security max-mac-count 200

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

 port-security ntk-mode ntkonly

 dot1x max-user 64

1.4.5  配置注意事项

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

l              在已经配置了安全模式的端口下,将不能再进行最大MAC地址学习个数、镜像反射端口、Fabric端口和端口汇聚的配置。

 

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

新华三官网
联系我们