Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Example: Disabling MAC Learning in a VLAN on a QFX Series Switch

 

When MAC learning is enabled, a MAC address is learned dynamically from a packet's source MAC address. By default, MAC learning is enabled on a VLAN. This topic provides examples for disabling, enabling, and verifying the operation of MAC learning in a VLAN. Disabling dynamic MAC learning in a VLAN on a QFX Series product prevents a node from learning source and destination MAC addresses. These examples require that you be logged in as the root user to the switch on which you wish to modify MAC learning. This example uses a VLAN named blue.

  • To disable MAC learning in a VLAN:

    [edit vlans vlan-name]
    user@switch# set no-mac-learning

    For example:

    [edit vlans blue]
    user@switch# set no-mac-learning
  • To verify that you have disabled MAC learning, issue the show ethernet-switching table command:

    user@switch> show ethernet-switching table

    The CLI output shows that the VLAN named blue is not configured for MAC learning. The Type column includes only static (MAC address that are manually created) and flood (MAC addresses that are unknown and flooded to all members of the VLAN) entries.

  • To reenable MAC learning in a VLAN, issue either of the following two commands::

    [edit vlans vlan-name]
    user@switch delete no-mac-learning


    user@switch# deactivate no-mac-learning

    For example:

    [edit vlans blue]
    user@switch delete no-mac-learning


    user@switch# deactivate no-mac-learning
  • To verify that you have enabled MAC learning, issue the show ethernet-switching table command:

    user@switch> show ethernet-switching table

    The CLI output shows that the VLAN named blue is configured for MAC learning. The Type column includes static (MAC address that are manually created), flood (MAC addresses that are unknown and flooded to all members of the VLAN), and .Learn (MAC addresses that are earned dynamically from a packet's source MAC address) entries.