MAC地址表包括两种类型的地址

1. 交换机动态学习的地址;

2. 通过手动绑定的静态地址。

 

无论是动态地址还是手动固定地址,MAC地址表包括目的MAC、VLAN ID、端口号、地址类型。

Eg

Switch#show mac-address-table                                     

Destination Address  Address Type VLAN  Destination Port

-------------------  ------------ ----  --------------------

cc00.4058.0000          Self          1    Vlan1

 

Switch#show mac-address-table interfacef0/1

 

手工静态指定MAC地址

Switch(config)#mac-address-table static0013.1a2f.0680 vlan 1 interface f0/2

 

指定丢弃某个MAC地址

Switch(config)#mac-address-table static 0013.1a2f.0680 vlan 2 drop

 

在接口或VLAN上禁止学习MAC地址

1. 在接口或SVI接口上禁用MAC地址学习,交换机将转发所有的IP包在2层域中;

2. 可以选择在单个VLAN上禁用MAC地址学习,VLAN 范围1-4094;

3. 建议在仅仅在VLAN的两个接口上禁用MAC地址学习,若在多个接口上禁用交换机或转发广播。

4. 不能在连接路由器的接口上禁用MAC地址学习。

5. 在配置了安全级别的接口上不能配置禁用MAC地址学习。

 

Configure

EgRouter(config)# no mac address-tablelearning vlan 200

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

 

Displaying MAC Address Table

show mac address-table address

show mac address-table aging-time

show mac address-table count

show mac address-table dynamic

show mac address-table interface

show mac address-table learning

show mac address-table static

show mac address-table vlan

http://www.cisco.com/c/en/us/td/docs/wireless/mwr_2941_dc/software_config/guide/3_3/2941_33_Config_Guide/mac_lrn.pdf

--------------------------------------------------------------------------------------------------------------------------------------