Layer 2 Diagnostic Commands

MAC Address Table

The MAC addres table keeps a record of the switch ports and VLANs to which a network host is associated too.

The switch builds its MAC address table by keeping track of the source MAC addresses of packets that it recieves through its ports. The information that the switch collects from these packets builds a table of MAC addresses to reduce the collision domain and reduce the number of packets that need to be broadcast out of every port with unknown unicast flooding.

The MAC address table can be displayed on a switch with the command show mac address-table. Some additional keywords can be suffixed onto the end of the command to provide additional functionality:

  • address mac-address xxxx.yyyy.zzzz – Displays entries that match the MAC addresse entered
  • dynamic – Displays entries that were learned by the switch only.
  • vlan X – Displays all MAC addresses present in the table that are associated with VLAN x

Some older technologies require a static MAC address to be programmed into the switch to prevent unknown unicast flooding.The command mac address-table static xxxx.yyyy.zzzz vlan x interface z adds a static entry to the MAC address table.

The MAC address table lives in a type of memory classed as content addressable memory or CAM. CAM uses a faster search technology that the traditional RAM found in switches, providing a binary result for any query sent to it. 0 is returned if the search is true, 1 is returned if the search is false.

The CAM can be used with other switch technologies that allow traffic to be analysed and forwarded very quickly. Switches have large content addressable memory to accommmodate for the larger amount of MAC addresses that they need to store for their forwarding tables.

Switch Port Status

The command show interfaces X switchport can provide all the information for a switch ports status. show interfaces switchport can also be used to display the same information but for all ports on a switch.

Interface Status

The command show interface status is another command for viewing the status of switchports in a simplified manner. The following fields are shown in the commands output:

PortDisplays the interface or port channel number
NameDisplays the configured interface description if it has one
StatusDisplays connected if a link is established and working, notconnected if a link is not detected and err-disabled if an error has been detected on the port and disabled by the switch.
VLANDisplays the VLAN number associated with the port. If the port is a trunk it displays trunk. If the port is configured as a layer 3 interface it displays routed.
DuplexDisplays the duplex setting of the port, if the duplex was negotiated rather than statically set it prefixes the value with a-.
SpeedDisplays the duplex setting of the port, if the duplex was negotiated rather than statically set it prefixes the value with a-.
TypeDisplays the physical type of port, for example if it is a copper port or a small formfactor pluggable (SFP) port
Show interface status values




Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.