Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Disabling MAC Learning in a VLAN

    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
      Ethernet-switching table: 5 entries, 2 learned
        VLAN              MAC address       Type         Age Interfaces
        blue              *                 Flood          - All-members
        blue              00:1f:12:39:90:80 Static         - Router
        default           *                 Flood          - All-members
        default           00:1f:12:39:90:89 Learn       3:15 ge-0/0/1.0
        default           00:1f:12:39:a3:81 Learn          0 ge-0/0/1.0

      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
      Ethernet-switching table: 6 entries, 3 learned
        VLAN              MAC address       Type         Age Interfaces
        blue              *                 Flood          - All-members
        blue              00:1f:12:39:90:80 Static         - Router
        blue              00:1f:12:39:a3:80 Learn          0 ge-0/0/9.0
        default           *                 Flood          - All-members
        default           00:1f:12:39:90:89 Learn          0 ge-0/0/1.0
        default           00:1f:12:39:a3:81 Learn          0 ge-0/0/1.0
      

      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.

    Published: 2013-08-15