Related Documentation
Configuring MAC Limiting (CLI Procedure)
![]() | Note: This task uses Junos OS for EX Series switches and QFX3500 and QFX3600 switches with support for the Enhanced Layer 2 Software (ELS) configuration style. If your switch runs software that does not support ELS, see Configuring MAC Limiting (CLI Procedure). For ELS details, see Getting Started with Enhanced Layer 2 Software. |
This topic describes various ways of configuring a limitation on MAC addresses in packets that are received and forwarded by the switch.
![]() | Note: On a QFX Series Virtual Chassis, if you include the shutdown option at the [edit vlans vlan-name switch-options interface interface-name interface-mac-limit packet-action] hierarchy level and issue the commit operation, the system generates a commit error. The system does not generate an error if you include the shutdown option at the [edit switch-options interface interface-name interface-mac-limit packet-action] hierarchy level. |
The different ways of setting a MAC limit are described in the following sections:
Limiting the Number of MAC Addresses Learned by an Interface
To secure a port, you can set the maximum number of MAC addresses that can be learned by an interface:
- Set the MAC limit on an interface, and specify an action
that the switch takes after the specified limit is exceeded:
[edit switch-options]
user@switch# set interface interface-name interface-mac-limit limit packet-action actionAfter you set a new MAC limit for the interface, the system clears existing entries in the MAC address forwarding table associated with the interface.
Limiting the Number of MAC Addresses Learned by a VLAN
To limit the number of MAC addresses learned by a VLAN, perform both of the following steps:
- Set the maximum number of MAC addresses that can be learned
by a VLAN, and specify an action that the switch takes after the specified
limit is exceeded:
[edit vlans]
user@switch# set vlan-name switch-options mac-table-size limit packet-action action - Set the maximum number of MAC addresses that can be learned
by one or all interfaces in the VLAN, and specify
an action that the switch takes after the specified limit is exceeded:
[edit vlans]
user@switch# set vlan-name switch-options interface interface-name interface-mac-limit limit packet-action action[edit vlans]
user@switch# set vlan-name switch-options interface-mac-limit limit packet-action action
Note: If you specify a MAC limit and packet action for all interfaces in the VLAN and a specific interface in the VLAN, the MAC limit and packet action specified at the specific interface level takes precedence. Also, at the VLAN interface level, only the drop and drop-and-log options are supported.
After you set new MAC limits for a VLAN by using the mac-table-size statement or for interfaces associated with a VLAN by using the interface-mac-limit statement, the system clears the corresponding existing entries in the MAC address forwarding table.