The mac-limit vlan rule-name command applies a global MAC address learning limit rule to a VLAN to which the specified interface belongs.
The undo mac-limit vlan rule-name command deletes a global MAC address learning limit rule applied to a VLAN to which the specified interface belongs.
By default, no global MAC address learning limit rule is applied to any VLAN to which the specified interface belongs.
Parameter | Description | Value |
---|---|---|
vlan-id1 | Specifies the VLAN ID associated with an Ethernet sub-interface. If the vlanBegin [ to vlanEnd ] parameters are run more than once, all configurations take effect. This parameter is only supported on Layer 2 interfaces. |
The value is an integer ranging from 1 to 4094. |
to vlan-id2 | Specifies the VLAN ID associated with an Ethernet sub-interface. If the vlanBegin [ to vlanEnd ] parameters are run more than once, all configurations take effect. This parameter is only supported on Layer 2 interfaces. |
The value is an integer ranging from 1 to 4094. |
rule-name | Specifies the name of a global MAC address learning limit rule. |
The value is a string of 1 to 31 characters. It does not support space, question mark, or subtraction sign. |
Usage Scenario
To control the number of users and protect a MAC address table against attacks, you can limit the number of MAC addresses that a device can learn. You can also configure the system to discard packets or generate an alarm to improve network security.
To apply a global MAC address learning limit rule to a VLAN to which the specified interface belongs, you can use the mac-limit vlan rule-name command in the interface view.Precautions
Ethernet interfaces, GE interfaces, and Eth-Trunk interfaces must be Layer 2 interfaces.
<HUAWEI> system-view [~HUAWEI] mac-limit rule-name name1 maximum 10000 rate 100 alarm enable [*HUAWEI] interface GigabitEthernet0/1/9 [*HUAWEI-GigabitEthernet0/1/9] portswitch [*HUAWEI-GigabitEthernet0/1/9] port trunk allow-pass vlan 10 [*HUAWEI-GigabitEthernet0/1/9] mac-limit vlan 10 rule-name name1