Cisco Nexus 1000V Layer 2 Switching Configuration Guide, Release 4.2(1)SV2(1.1)
Configuring the MAC Address Table
Downloads: This chapterpdf (PDF - 1.18MB) The complete bookPDF (PDF - 2.49MB) | The complete bookePub (ePub - 269.0KB) | Feedback

Configuring the MAC Address Table

Configuring the MAC Address Table

This chapter contains the following sections:

Information About the MAC Address Table

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. Then 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 32000 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, clearing the table, and so forth.

Guidelines and Limitations

  • The forwarding table for each VLAN in a VEM can store up to 4094 MAC addresses.
  • You can configure only 1024 static MAC addresses on a single interface.
  • Cisco Nexus 1000V supports a maximum of 2000 user configured static MAC addresses on a VSM
  • 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

Use this procedure to configure a MAC address to statically point to a specific interface.

Before You Begin
  • You are logged in to the CLI in EXEC mode.
  • You cannot configure broadcast or multicast addresses as static MAC addresses.
  • Static MAC addresses override dynamically-learned MAC addresses on an interface.

Note


Be aware that the Cisco NX-OS commands may differ from those 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 { type if_id } | port-channel number ]} 

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

    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.

     
    switch# configure terminal
    switch(config)# mac address static
    switch(config)# show mac address static
    VLAN      MAC Address       Type    Age       Port                           Module   
    ---------+-----------------+-------+---------+------------------------------+---------
    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

    Use this procedure to configure the amount of time that packet source MAC addresses, and the ports on which they are learned, remain in the MAC table containing the Layer 2 information.


    Note


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


    Before You Begin You are logged in to the CLI in EXEC mode.

    Note


    Be aware that the Cisco NX-OS commands may differ from those 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 include:

      • 120 to 918000 seconds (default is 300)
      • If you specify zero (0), MAC aging is disabled.
       
      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

      You are logged in to the CLI in EXEC mode.


      Note


      Be aware that the Cisco NX-OS commands may differ from those 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.

         

        The following example clears the entire MAC address table of all dynamic entries:

        switch# clear mac address-table dynamic
        switch#
        

        The following example clears 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 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 burn-in MAC address for an interface.

        Example for show mac address-table

        switch# show mac address-table
        VLAN      MAC Address       Type    Age       Port                           Module   
        ---------+-----------------+-------+---------+------------------------------+---------
        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        
        342       0050.568d.5a3f    dynamic 0         Eth3/3                         3        
        343       0002.3d21.5502    static  0         N1KV Internal Port             3        
        343       0050.568d.2aa0    dynamic 9         Eth3/3                         3        
        Total MAC Addresses: 13
        switch#
        

        Example for show mac address-table static | inc veth

        switch# show mac address-table static | inc veth
        460       0050.5678.ed16    static  0         Veth2                          3        
        460       0050.567b.1864    static  0         Veth1                          4        
        switch#
        

        Example for show mac address static

        switch# show mac address static
        VLAN      MAC Address       Type    Age       Port                           Module   
        ---------+-----------------+-------+---------+------------------------------+---------
        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 
        switch(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#
        

        Example for show mac address static interface

        switch# 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# 

        Example for show mac address-table aging-time

        switch# show mac address-table aging-time
        Vlan  Aging Time
        ----- ----------
        101   300       
        100   300       
        1     300       
        switch# 

        Example for show mac address-table count

        switch# show mac address-table count static
        Total MAC Addresses: 12
        switch# 

        Configuration Example for the MAC Address Table

        The following 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 the MAC Address Table

        Feature Name

        Feature Name

        Releases

        MAC Address Tables

        4.0(4)SV1(1)

        This feature was introduced