27-端口安全快速配置指南
本章节下载 (202.70 KB)
端口安全快速配置指南
Copyright © 2024 新华三技术有限公司 版权所有,保留一切权利。
非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。
除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。
本文档中的信息可能变动,恕不另行通知。
本案例介绍端口安全autoLearn模式的配置方法。
如图1所示,用户通过Device连接到网络。通过配置端口安全autolearn模式,实现对接入用户的控制,具体需求如下:
· 最多同时允许64个用户直接通过交换机接入Internet,无需进行认证;
· 当用户数量超过设定值后,新用户无法通过Device接入Internet;
· 配置安全MAC地址并设定安全MAC地址老化时间,来防止交换机与用户相连端口学习到的MAC地址的丢失,及安全MAC地址不老化带来的一些问题;
· 配置入侵检测特性方式为disableport-temporarily,当再有新的MAC地址接入时,交换机与用户相连端口被暂时断开连接,30秒后自动恢复端口的开启状态。
图1 端口安全autoLearn模式组网图
当端口工作于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/1
[Device-Ten-GigabitEthernet1/0/1] port-security max-mac-count 64
# 设置端口安全模式为autoLearn。
[Device-Ten-GigabitEthernet1/0/1] port-security port-mode autolearn
# 设置触发入侵检测特性后的保护动作为暂时关闭端口,关闭时间为30秒。
[Device-Ten-GigabitEthernet1/0/1] port-security intrusion-mode disableport-temporarily
[Device-Ten-GigabitEthernet1/0/1] quit
[Device] port-security timer disableport 30
# 上述配置完成后,可以使用display port-security interface命令查看端口安全的配置情况。
[Device] display port-security interface ten-gigabitethernet 1/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
OUI value list :
Ten-GigabitEthernet1/0/1 is link-up
Port mode : autoLearn
NeedToKnow mode : Disabled
Intrusion protection mode : DisablePortTemporarily
Security MAC address attribute
Learning mode : Sticky
Aging type : Periodical
Max secure MAC addresses : 64
Current secure MAC addresses : 5
Authorization : Permitted
NAS-ID profile : Not configured
Free VLANs : Not configured
Open authentication : Disabled
MAC-move VLAN check bypass : Disabled
可以看到端口安全所允许的最大安全MAC地址数为64,端口模式为autoLearn,入侵检测保护动作为DisablePortTemporarily,入侵发生后端口被禁用时间为30秒。
配置生效后,端口允许地址学习,学习到的MAC地址数可在上述显示信息的“Current secure MAC addresses”字段查看到。
# 具体的MAC地址信息可以在二层以太网接口视图下用display this命令查看。
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] display this
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
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/1
port link-mode bridge
port-security intrusion-mode disableport-temporarily
port-security max-mac-count 64
port-security port-mode autolearn
#
· 产品配套“安全配置指导”中的“端口安全”。
· 产品配套“安全命令参考”中的“端口安全”。
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!