Cisco Nexus 1000V Layer 2 Switching Configuration Guide, Release 4.2(1)SV2(2.1)
Configuring MAC Address Tables
Downloads: This chapterpdf (PDF - 1.17MB) The complete bookPDF (PDF - 2.52MB) | The complete bookePub (ePub - 310.0KB) | Feedback

Configuring MAC Address Tables

Configuring MAC Address Tables

This chapter contains the following sections:

Information About MAC Address Tables

Layer 2 ports correlate the MAC address on a packet with the Layer 2 port information for that packet using the MAC address table. A MAC address table is built using the MAC source addresses of the frames received. When a frame is received for a MAC destination address not listed in the address table, the frame is flooded to all LAN ports of the same VLAN with the exception of the port that received the frame. When the destination station replies, the relevant MAC source addresses and port IDs are added to the address table. Subsequent frames are forwarded to a single LAN port without flooding all LAN ports.

You can configure MAC addresses, which are called static MAC addresses, to statically point to specified interfaces on the device. These static MAC addresses override any dynamically learned MAC addresses on those interfaces. You cannot configure broadcast or multicast addresses as static MAC addresses. The static MAC entries are retained across reboots.

The address table per VEM can store up to 32,000 MAC entries. An aging timer triggers removal of addresses from the table when they remain inactive for the default time of 300 seconds. The aging timer can be configured on a global basis but not per VLAN.

You can configure the length of time an entry remains in the MAC address table, clear the table, and so forth.

Guidelines and Limitations

  • The forwarding table for each VLAN in a VEM can store up to 4096 MAC addresses.
  • You can configure only 32 static MAC addresses on a single interface and 1024 static MAC addresses DVS wide.
  • Cisco Nexus 1000V supports a maximum of 2000 private VLAN MAC addresses on a VSM.

Default Settings

Table 1 Default MAC Address Aging Time

Parameters

Default

Aging time

300 seconds

Configuring the MAC Address Table

Configuring a Static MAC Address

You can configure a MAC address to statically point to a specific interface.

Before You Begin
  • Log in to the CLI in EXEC mode.
  • Know that you cannot configure broadcast or multicast addresses as static MAC addresses.
  • Know that static MAC addresses override dynamically learned MAC addresses on an interface.

Note


Be aware that the Cisco NX-OS commands may differ from those commands used in Cisco IOS.
Procedure
      Command or Action Purpose
    Step 1 switch# configure terminal 

    Enters global configuration mode.

     
    Step 2 switch(config)# mac address-table static mac_address vlan vlan-id {[drop | interface {typeif_id} | port-channel number]} 

    Adds a static MAC address in the Layer 2 MAC address table and saves it in the running configuration.

    The interface can be specified as either of the following:

    • ethernet slot/port
    • veth number
     
    Step 3 switch(config)# show mac address static interface [type if_id ]  (Optional)

    Displays static MAC addresses.

     
    Step 4 switch(config)# copy running-config startup-config  (Optional)

    Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

     

    This example shows how to configure a static MAC address:

    switch# configure terminal
    switch(config)# mac address static
    switch(config)# show mac address static
    VLAN      MAC Address       Type    Age       Port                           Mod   
    ---------+-----------------+-------+---------+------------------------------+---------
    1         0002.3d11.5502    static  0         N1KV Internal Port             3        
    1         0002.3d21.5500    static  0         N1KV Internal Port             3        
    1         0002.3d21.5502    static  0         N1KV Internal Port             3        
    1         0002.3d31.5502    static  0         N1KV Internal Port             3        
    1         0002.3d41.5502    static  0         N1KV Internal Port             3        
    1         0002.3d61.5500    static  0         N1KV Internal Port             3        
    1         0002.3d61.5502    static  0         N1KV Internal Port             3        
    1         0002.3d81.5502    static  0         N1KV Internal Port             3        
    3         12ab.47dd.ff89    static  0         Eth3/3                         3        
    342       0002.3d41.5502    static  0         N1KV Internal Port             3        
    343       0002.3d21.5502    static  0         N1KV Internal Port             3        
    Total MAC Addresses: 11 
    n1000v(config)# show mac address static interface Ethernet 3/3
    VLAN      MAC Address       Type    Age       Port                           Module   
    ---------+-----------------+-------+---------+------------------------------+---------
    3         12ab.47dd.ff89    static  0         Eth3/3                         3        
    Total MAC Addresses: 1 
    switch(config)# 
    

    Configuring the Aging Time

    You can configure the amount of time that packet source MAC addresses, and the ports on which they are learned, remain in the MAC table.


    Note


    The aging time is a global setting that cannot be configured per VLAN. Although it is a global setting, you can also configure the MAC aging time in interface configuration mode or VLAN configuration mode.


    Before You BeginLog in to the CLI in EXEC mode.

    Note


    Be aware that the Cisco NX-OS commands may differ from those commands used in Cisco IOS.


    Procedure
        Command or Action Purpose
      Step 1 switch# configure terminal 

      Enters global configuration mode.

       
      Step 2 switch# mac address-table aging-time seconds 

      Specifies and saves in the running configuration the amount of time that will elapse before an entry in the Layer 2 MAC address table is discarded.

      Allowable entries are as follows:

      • 120 to 918000 seconds (default is 300)
      • If you specify zero (0), MAC aging is disabled.
       

      This example shows how to configure the aging time:

      switch# configure terminal
      switch(config)# mac address-table aging-time 600
      switch(config)# show mac address-table aging-time
      Vlan  Aging Time
      ----- ----------
      101   300       
      100   300       
      1     300       
      switch# 
      

      Clearing Dynamic Addresses from the MAC Address Table

      Before You Begin

      Log in to the CLI in EXEC mode.


      Note


      Be aware that the Cisco NX-OS commands may differ from those commands used in Cisco IOS.
      Procedure
          Command or Action Purpose
        Step 1 switch# clear mac address-table dynamic [vlan vlan_id] 

        Clears the dynamic address entries from the Layer 2 MAC address table.

         
        Step 2 switch# show mac address-table  (Optional)

        Displays the MAC address table.

         

        This example shows how to clear the entire MAC address table of all dynamic entries:

        switch# clear mac address-table dynamic
        switch#
        

        This example shows how to clear the MAC address table of only those dynamic MAC addresses learned on VLAN 5:

        switch# clear mac address-table dynamic vlan 5
        switch#

        Verifying the MAC Address Table Configuration

        Use one of the following commands to verify the configuration:

        Command Purpose

        show mac address-table

        Displays the MAC address table.

        show mac address-table module

        Use the show mac address-table module mod id command to debug a specific module.

        show mac address-table static

        Displays information about the MAC address table static entries.

        show mac address-table static | inc veth

        Displays the static MAC address of vEthernet interfaces in case a VEM physical port learns a dynamic MAC and the packet source is in another VEM on the same VSM.

        show mac address static interface [ type if_id ]

        Displays all static MAC addresses.

        show mac address-table aging-time

        Displays the aging time in the MAC address table.

        show mac address-table count

        Displays a count of MAC address entries.

        show interface interface_id mac

        Displays the MAC addresses and the burned-in MAC address for an interface.

        Configuration Example for MAC Address Tables

        This example shows how to add a static MAC address and establish a global aging time:

        switch# configure terminal
        switch(config)# mac address-table static 0000.0000.1234 vlan 10 interface ethernet 2/15
        switch(config)# mac address-table aging-time 120
        switch(config)# 

        Feature History for MAC Address Tables

        Feature Name

        Feature Name

        Releases

        MAC Address Tables

        4.0(4)SV1(1)

        This feature was introduced.