1. 组网需求
在交换机的端口Ethernet1/0/1上对接入用户做如下的:
允许最多1个用户自由接入,不进行认证,将学习到的用户MAC地址添加为Secure MAC地址;
为确保用户Host能够接入,将该用户的MAC地址0001-0002-0003作为Secure MAC地址,添加到VLAN 1中;
当Secure MAC地址数量达到80后,停止学习;当再有新的MAC地址接入时,触发Intrusion Protection特性,并将此端口关闭30秒。
2. 组网图
图1-5 端口安全autolearn模式组网图
3. 配置步骤
# 进入系统视图。
[Switch] port-security enable # 进入以太网Ethernet1/0/1端口视图。 [Switch] interface Ethernet1/0/1 # 设置端口允许接入的最大MAC地址数为1。 [Switch-Ethernet1/0/1] port-security max-mac-count 1 # 配置端口的安全模式为autolearn。 [Switch-Ethernet1/0/1] port-security port-mode autolearn # 将Host 的MAC地址0001-0002-0003作为Secure 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下载本文