Limiting MAC Addresses Learned from an Interface in a Bridge Domain
You can configure a limit on the number of MAC addresses learned from a specific bridge domain or from a specific logical interface that belongs to a bridge domain.
To configure a limit for the number of MAC addresses
learned from each logical interface in a bridge domain, include the interface-mac-limit limit
statement at
the [edit bridge-domains bridge-domain-name bridge-options]
hierarchy level:
[edit] bridge-domains { bridge-domain-name { domain-type bridge; interface interface-name; bridge-options { interface-mac-limit limit; } } }
To limit the number of MAC addresses learned from a specific
logical interface in a bridge domain or an entire bridge domain, include
the interface-mac-limit limit
statement
at the [edit bridge-domains bridge-domain-name bridge-options interface interface-name]
or [edit bridge-domains bridge-domain-name bridge-options]
hierarchy level:
[edit] bridge-domains { bridge-domain-name { domain-type bridge; interface interface-name; bridge-options { interface-mac-limit limit{ packet-action drop; } interface interface-name { interface-mac-limit limit{ packet-action drop; } } } } }
For an access port, the default limit on the maximum number
of MAC addresses that can be learned on an access port is 1024. Because
an access port can be configured in only one bridge domain in a network
topology, the default limit is 1024 addresses, which is same as the
limit for MAC addresses learned on a logical interface in a bridge
domain (configured by including the interface-mac-limit limit
statement at the [edit bridge-domains bridge-domain-name bridge-options interface interface-name]
or [edit bridge-domains bridge-domain-name bridge-options]
hierarchy level.
For a trunk port, the default limit on the maximum number of
MAC addresses that can be learned on a trunk port is 8192. Because
a trunk port can be associated with multiple bride domains, the default
limit is the same as the limit for MAC addresses learned on a logical
interface in a virtual switch instance (configured by including the interface-mac-limit limit
statement at
the [edit routing-instances routing-instance-name switch- options interface interface-name]
for a virtual switch instance).
The value you configure for a specific logical interface overrides
any value you specify for the entire bridge domain at the [edit
bridge-domains bridge-domain-name bridge-options]
hierarchy level.
The default limit to the number of MAC addresses that can be learned on a logical interface is 1024. The range that you can configure for a specific logical interface is 1 through 131,071.
After the MAC address limit is reached, the default is
for any incoming packets with a new source MAC address to be forwarded.
You can specify that the packets be dropped by including the packet-action drop
statement. To specify that packets be dropped
for the entire bridge domain, include the packet-action drop
statement at the [edit bridge-domains bridge-domain-name bridge-options interface-mac-limit limit]
hierarchy level:
[edit bridge-domains bridge-domain-name bridge-options interface-mac-limit limit] packet-action drop;
To specify that the packets be dropped for a specific
logical interface in a bridge domain, include the packet-action
drop
statement at the [edit bridge-domains bridge-domain-name bridge-options interface interface-name interface-mac-limit limit]
hierarchy
level:
[edit bridge-domains bridge-domain-name bridge-options interface interface-name interface-mac-limit limit] packet-action drop;
The behavior is different for some configurations. For aggregated Ethernet interfaces and label-switched interfaces, the behavior is to learn all the new MAC addresses even when the limit has been reached. The excess addresses are later deleted. The learning limit does not apply to bridge domain trunk ports, because they have no counters for the individual domains, and those domains might have different MAC learning limits.
When static MAC addresses are configured, the learning limit is the configured limit minus the number of static addresses.
On MX Series routers running Junos OS Release 8.4 and later, statistics for an aged destination MAC entry are not retained. In addition, source and destination statistics are reset during a MAC move. In previous releases, only source statistics were reset during a MAC move.
You can also configure a limit to the number of MAC addresses learned for an MX Series router.