Cisco MWR 2941 Mobile Wireless Edge Router Software Configuration Guide, Release 15.0(1)MR
Managing the MAC Address Table

Table Of Contents

Managing the MAC Address Table

Disabling MAC Address Learning on an Interface or VLAN

Displaying Address Table Entries


Managing the MAC Address Table


The MAC address table contains address information that the switch uses to forward traffic between ports. All MAC addresses in the address table are associated with one or more ports. The address table includes these types of addresses:

Dynamic address: a source MAC address that the switch learns and then ages when it is not in use.

Static address: a manually entered unicast address that does not age and that is not lost when the switch resets.

The address table lists the destination MAC address, the associated VLAN ID, and port number associated with the address and the type (static or dynamic).

MAC address table management can be used with the STP, MSTP, and REP features. For more information about configuring SPAN, see Chapter 9 "Configuring STP." For more information about configuring RSPAN, see Chapter 10 "Configuring MSTP." For more information about configuring REP, see Chapter 14 "Configuring Resilient Ethernet Protocol."

The following sections describe how to manage the MAC address table:

Disabling MAC Address Learning on an Interface or VLAN

Displaying Address Table Entries

Disabling MAC Address Learning on an Interface or VLAN

By default, MAC address learning is enabled on all interfaces and VLANs on the router. You can control MAC address learning on an interface or VLAN to manage the available MAC address table space by controlling which interfaces or VLANs can learn MAC addresses. Before you disable MAC address learning, be sure that you are familiar with the network topology and the router system configuration. Disabling MAC address learning on an interface or VLAN could cause flooding in the network.

Follow these guidelines when disabling MAC address learning on an interface or VLAN:

Use caution before disabling MAC address learning on an interface or VLAN with a configured switch virtual interface (SVI). The switch then floods all IP packets in the Layer 2 domain.

You can disable MAC address learning on a single VLAN ID from 1 to 4094 (for example, no mac address-table learning vlan 223) or a range of VLAN IDs, separated by a hyphen or comma (for example, no mac address-table learning vlan 1-10, 15).

We recommend that you disable MAC address learning only in VLANs with two ports. If you disable MAC address learning on a VLAN with more than two ports, every packet entering the switch is flooded in that VLAN domain.

You cannot disable MAC address learning on a VLAN that is used internally by the router. If the VLAN ID that you enter is an internal VLAN, the switch generates an error message and rejects the command. To view internal VLANs in use, enter the show vlan internal usage privileged EXEC command.

If you disable MAC address learning on a VLAN that includes a secure port, MAC address learning is not disabled on that port.

Beginning in privileged EXEC mode, follow these steps to disable MAC address learning on a VLAN:

 
Command
Purpose

Step 1 

configure terminal

Enter global configuration mode.

Step 2 

no mac-address-table learning {vlan vlan-id [,vlan-id | -vlan-id] | interface interface slot/port}

Disable MAC address learning on an interface or on a specified VLAN or VLANs.

You can specify a single VLAN ID or a range of VLAN IDs separated by a hyphen or comma. Valid VLAN IDs 1 to 4094. It cannot be an internal VLAN.

Step 3 

end

Return to privileged EXEC mode.

Step 4 

show mac address-table learning [vlan vlan-id | interface interface slot/port]

Verify the configuration.

Step 5 

copy running-config startup-config

(Optional) Save your entries in the configuration file.

To reenable MAC address learning on an interface or VLAN, use the default mac address-table learning global configuration command. You can also reenable MAC address learning on a VLAN by entering the mac address-table learning global configuration command. The first (default) command returns to a default condition and therefore does not appear in the output from the show running-config command. The second command causes the configuration to appear in the show running-config privileged EXEC command display.

This example shows how to disable MAC address learning on VLAN 200:

Router(config)# no mac address-table learning vlan 200

This example shows how to disable MAC-address learning for all modules on a specific routed interface:

Router(config)# no mac-address-table learning interface GigabitEthernet 0/5
Router(config)# 

You can display the MAC address learning status of all VLANs or a specified VLAN by entering the show mac-address-table learning [vlan vlan-id] privileged EXEC command.

Displaying Address Table Entries

You can display the MAC address table by using one or more of the privileged EXEC commands described in Table 12-1:

Table 12-1 Commands for Displaying the MAC Address Table 

Command
Description

show mac address-table address

Displays MAC address table information for the specified MAC address.

show mac address-table aging-time

Displays the aging time in all VLANs or the specified VLAN.

show mac address-table count

Displays the number of addresses present in all VLANs or the specified VLAN.

show mac address-table dynamic

Displays only dynamic MAC address table entries.

show mac address-table interface

Displays the MAC address table information for the specified interface.

show mac address-table learning

Displays MAC address learning status of all VLANs or the specified VLAN.

show mac address-table static

Displays only static MAC address table entries.

show mac address-table vlan

Displays the MAC address table information for the specified VLAN.