Command For Mac Address Table



Home > Articles > Cisco > CCNA Routing and Switching

  1. MAC Address Tables
< BackPage 3 of 5Next >
Like this article? We recommend

You can use the mac-address-table static command to assign a static MA C address to a virtual interface. Configuring the Aging Time for the MAC Table You can configure the amount of time that an entry (the packet source MAC address and port that packet. Use this method to obtain the MAC Address of your local computer as well as query remotely by computer name or IP Address. Hold down the “Windows Key” and press “R“. Type “CMD“, then press “Enter“. You can use one of the following commands: GETMAC /s computername – Get MAC Address remotely by Computer Name. Command complement; Clear Mac address table: Switch# clear mac-address-table Switch# clear mac-address-table vlan 90: Switch(config)#mac address-table aging-time 300: Default: 300sec = 5 minites: Setting Mac address. Switch(config)#mac address-table static 0010.aaaa.aaaa vlan. As a practice, try issuing command ipconfig /all on Windows CLI and show mac address-table on Cisco switch CLI to get warmed up for later examples. The command show mac address-table, not surprisingly, is used to display the MAC address table of a switch we just talked about, as shown below: SW1#show mac address-table.

Address
CCNA Routing and Switching 200-120 Network Simulator

Like this article? We recommend

Like this article? We recommend

CCNA Routing and Switching 200-120 Network Simulator

MAC Address Tables

A MAC address table, sometimes called a Content Addressable Memory (CAM) table, is used on Ethernet switches to determine where to forward traffic on a LAN. Now let's break this down a little bit to understand how the MAC address table is built and used by an Ethernet switch to help traffic move along the path to its destination. We will use the graphic in Figure 1.

In Figure 1, a switch is surrounded by a number of common devices. Let's assume that all of the devices are powered on but have not sent any traffic. In this case, the MAC address table of the switch would be empty (ignoring any system MAC addresses shown in the table by default).

Now suppose PC1 wants to send traffic to the server that has a MAC address of 00:00:00:00:00:01. It would encapsulate an Ethernet frame and send it off toward the switch. The first thing the switch would do when receiving the traffic is create a new entry in its MAC address table for PC1's MAC address (PC1 -> Fa0/3). The switch would then perform a lookup on its MAC address table to determine whether it knows which port to send the traffic to; since no matching entries exist in the switch's tables, it would flood the frame out all of its interfaces (except the receiving port).

Because the frame was sent out to all of the switch's other ports, it would be received by the target server. Assuming that the server wants to respond to PC1, it would sent a new frame back toward the switch. The switch would receive the frame and create a new entry in its MAC address table for the server's MAC address (Server -> Fa0/2). It would then perform a lookup of its MAC address table to determine whether it knows which port to send the server's traffic to; in this case it does, so it sends the return traffic out only its Fa0/3 port (PC1), without flooding. Listing 1 shows what the MAC address table would look like at this point.

Command To Show Mac Address Table In Switch

Listing 1—MAC address table example.

This process repeats as devices continue to send traffic to each other. An important detail to remember is that the MAC address table timeout is typically short (Cisco's default is five minutes), so an entry is left in the table itself only for that specified amount of time before the timeout expires and the entry is removed from the table.

Now we will move on to the question of how the devices get the destination MAC addresses to begin this process; in a word, ARP.

Related Resources

  • Book $55.99
  • Book $55.99
  • Premium Edition eBook $55.99

We can find mac address (physical address) of a computer using the command ‘getmac‘. This can be used to get mac address for remote computers also. Below are few examples on how to use this command. It works on XP, Vista, Windows 7, Server 2003 and Server 2008 operating systems.

Get mac addresses from CMD

Just run the command getmac to get the mac addresses. Find an example below.

This command does not show mac addresses for the network connections which are disabled. You can run ncpa.cpl and check which NICs are disabled. Further, I have received comments that this command does not help identify the mac address for a specific device. For example, if I need to get the mac address for my WiFi card, output of getmac command is not helpful. We can use ipconfig command to deal with this.

Command For Mac Address Table Drop

Get mac address of a remote computer

We can retrieve the mac addressses for a remote computer using nbtstat command.
Example:

Alternatively, We can run the below command to retrieve the mac addresses of a remote computer.

Cisco Command Mac Address Table

remote_computer : Full name of the remote computer or IP address
username and password are of the account on the remote computer.

Cisco Show Mac Address Table

Example:

Command For Mac Address Table Notification Mac Move

If you do not want to specify the password, you can skip /p parameter. You will be prompted to enter the password and the command execution will take place after that.

Errors:

Using getmac command we can retrieve the mac addresses of the machines running windows OS only. If you try this for a Linux machine you would get the error “The RPC server is unavailable.”

Sh mac address table command

If you provide incorrect password, the command would fail with the error message “Logon failure: unknown user name or bad password.

Switch Mac Address Table

Also Read:
Windows CMD commands reference