02-H3C_端口安全配置举例
本章节下载: 02-H3C_端口安全配置举例 (166.08 KB)
H3C端口安全配置举例
Copyright © 2017 新华三技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部, 并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
|
目 录
本文档介绍端口安全的配置举例。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文假设您已了解端口安全特性。
· 如果已全局开启了MAC地址认证功能,则无法使能端口安全功能。
· 当端口安全功能开启后,端口上的MAC地址认证功能将不能被手动开启。
· 端口上有用户在线的情况下,端口安全功能无法关闭。
· 端口安全模式的配置与端口加入聚合组互斥。
· 当多个用户通过认证时,端口下所允许的最大用户数根据不同的端口安全模式,取端口安全所允许的最大MAC地址数与相应模式下允许认证用户数的最小值。例如,userLoginSecureExt模式下,端口下所允许的最大用户为配置的端口安全所允许的最大MAC地址数与MAC地址认证所允许的最大用户数的最小值。
· 当端口安全已经使能且当前端口安全模式不是noRestrictions时,若要改变端口安全模式,必须首先执行undo port-security port-mode命令恢复端口安全模式为noRestrictions模式。
如图4-1所示,用户通过Device连接到网络。通过配置端口安全autolearn模式,实现对接入用户的控制,具体需求如下:
· 最多同时允许64个用户直接通过交换机接入Internet,无需进行认证;
· 当用户数量超过设定值后,新用户无法通过Device接入Internet。
图4-1 端口安全autoLearn模式组网图
· 配置交换机与用户相连端口的安全模式为autolearn,允许用户自由接入。
· 为防止交换机与用户相连端口学习到的MAC地址的丢失,及安全MAC地址不老化会带来一些问题,需配置安全MAC地址并设定安全MAC地址老化时间(例如30分钟)。
· 配置最大安全MAC地址数为64,当安全MAC地址数量达到64后,停止学习;配置入侵检测特性方式为disableport-temporarily,当再有新的MAC地址接入时,交换机与用户相连端口被暂时断开连接,30秒后自动恢复端口的开启状态。
本举例是在S3210-CMW710-R7566版本上进行配置和验证的。
当端口工作于autoLearn模式时,无法更改端口安全允许的最大MAC地址数。
# 使能端口安全。
<Device> system-view
[Device] port-security enable
# 设置安全MAC地址的老化时间为30分钟。
[Device] port-security timer autolearn aging 30
# 设置端口安全允许的最大安全MAC地址数为64。
[Device] interface ten-gigabitethernet 1/0/25
[Device-Ten-GigabitEthernet1/0/25] port-security max-mac-count 64
# 设置端口安全模式为autoLearn。
[Device-Ten-GigabitEthernet1/0/25] port-security port-mode autolearn
# 设置触发入侵检测特性后的保护动作为暂时关闭端口,关闭时间为30秒。
[Device-Ten-GigabitEthernet1/0/25] port-security intrusion-mode disableport-temporarily
[Device-Ten-GigabitEthernet1/0/25] quit
[Device] port-security timer disableport 30
# 上述配置完成后,可以使用display port-security interface命令查看端口安全的配置情况。
[Device] display port-security interface ten-gigabitethernet 1/0/25
Global port security parameters:
Port security : Enabled
AutoLearn aging time : 30 min
Disableport timeout : 30 s
MAC move : Denied
Authorization fail : Online
NAS-ID profile : Not configured
Dot1x-failure trap : Disabled
Dot1x-logon trap : Disabled
Dot1x-logoff trap : Disabled
Intrusion trap : Disabled
Address-learned trap : Disabled
Mac-auth-failure trap : Disabled
Mac-auth-logon trap : Disabled
Mac-auth-logoff trap : Disabled
Open authentication : Disabled
OUI value list :
Ten-GigabitEthernet1/0/25is link-down
Port mode : autoLearn
NeedToKnow mode : Disabled
Intrusion protection mode : DisablePortTemporarily
Security MAC address attribute
Learning mode : Sticky
Aging type : Periodical
Max secure MAC addresses : 64
Current secure MAC addresses : 5
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
可以看到端口安全所允许的最大安全MAC地址数为64,端口模式为autoLearn,入侵检测保护动作为DisablePortTemporarily,入侵发生后端口被禁用时间为30秒。
配置生效后,端口允许地址学习,学习到的MAC地址数可在上述显示信息的“Current secure MAC addresses”字段查看到。
# 具体的MAC地址信息可以在二层以太网接口视图下用display this命令查看。
[Device] interface ten-gigabitethernet 1/0/25
[Device-Ten-GigabitEthernet1/0/25] display this
#
interface Ten-GigabitEthernet1/0/25
port-security intrusion-mode disableport-temporarily
port-security max-mac-count 64
port-security port-mode autolearn
port-security mac-address security sticky 00e0-fc00-5920 vlan 1
port-security mac-address security sticky 00e0-fc00-592a vlan 1
port-security mac-address security sticky 00e0-fc00-592b vlan 1
port-security mac-address security sticky 00e0-fc00-592c vlan 1
port-security mac-address security sticky 00e0-fc00-592d vlan 1
#
当学习到的MAC地址数达到64后,用命令display port-security interface可以看到端口模式变为secure,再有新的MAC地址到达将触发入侵保护,可以通过命令display interface看到此端口关闭。30秒后,端口状态恢复。此时,如果手动删除几条安全MAC地址后,端口安全的状态重新恢复为autoLearn,可以继续学习MAC地址。
#
port-security enable
port-security timer disableport 30
port-security timer autolearn aging 30
#
interface Ten-GigabitEthernet1/0/25
port-security intrusion-mode disableport-temporarily
port-security max-mac-count 64
port-security port-mode autolearn
#
· H3C S3210系列以太网PON OLT交换机 安全配置指导-R7566
· H3C S3210系列以太网PON OLT交换机 安全命令参考-R7566
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!