如何限制802.1X认证接口可以学习的MAC地址数量
由于802.1X认证功能与mac-limit命令(配置接口能够学习的最大MAC地址数量)以及mac-address learning disable命令(关闭接口的MAC地址学习功能)冲突,因此当接口使能802.1X认证功能之后,无法再通过执行mac-limit命令和mac-address learning disable命令限制接口可以学习的MAC地址数量,下面是几种替代方法。
(适用于V200R005-V200R008版本)通过限制接口下允许接入的用户数量,从而限制该接口可以学习的MAC地址数量。
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] authentication mode multi-authen max-user 3
(适用于V200R009及之后版本)通过在认证模板下配置允许接入的802.1X认证用户数量并将该模板应用到指定接口,从而限制该接口可以学习的MAC地址数量。
<HUAWEI> system-view [HUAWEI] dot1x-access-profile name d1 [HUAWEI-dot1x-access-profile-d1] quit //缺省的802.1X认证方式为EAP中继认证 [HUAWEI] authentication-profile name p1 [HUAWEI-authen-profile-p1] dot1x-access-profile d1 [HUAWEI-authen-profile-p1] authentication mode multi-authen max-user 3 dot1x [HUAWEI-authen-profile-p1] quit [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] authentication-profile p1
(适用于V200R012及之后版本)在接口下配置端口安全功能,并限制该接口能够学习的MAC地址数量。
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port-security enable [HUAWEI-GigabitEthernet0/0/1] port-security max-mac-num 3