The 802.1X authentication function conflicts with the mac-limit command (configuring the maximum number of MAC addresses that can be learned through an interface) and the mac-address learning disable command (disabling MAC address learning on an interface). Therefore, after 802.1X authentication is enabled on an interface, you cannot run the mac-limit and mac-address learning disable commands to limit the number of MAC addresses that can be learned through the interface. The following describes some alternative methods.
(Applicable to versions from V200R005 to V200R008) Limit the number of concurrent access users on an interface to limit the number of MAC addresses that can be learned through the interface.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] authentication mode multi-authen max-user 3
(Applicable to V200R009 and later versions) Configure the number of concurrent access users for 802.1X authentication in the authentication profile and apply the profile to the specified interface to limit the number of MAC addresses that can be learned through the interface.
<HUAWEI> system-view [HUAWEI] dot1x-access-profile name d1 [HUAWEI-dot1x-access-profile-d1] quit //The default 802.1X authentication mode is EAP relay authentication. [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
(Applicable to V200R012 and later versions) Configure port security on an interface and limit the number of MAC addresses that can be learned through the interface.
<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