switch# show ip arp fa 0/1   
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.1.1      216   0003.4798.7cf9  ARPA   FastEthernet0/1
Internet  192.168.1.2          -   001a.6c9d.22c1  ARPA   FastEthernet0/1
Internet  192.168.1.3        198   000e.0c31.4327  ARPA   FastEthernet0/1
Internet  192.168.1.4          2   0011.2530.afd7  ARPA   FastEthernet0/1
Internet  192.168.1.5        20   0005.5de6.f2c5  ARPA   FastEthernet0/1
Internet  192.168.1.6         10   0060.08af.737b  ARPA   FastEthernet0/1
Internet  192.168.1.7          -   001a.6c9d.22c1  ARPA   FastEthernet0/1
Internet  192.168.1.8       134   0010.5cf5.2c4e  ARPA   FastEthernet0/1
Internet  192.168.1.9          1   000f.fe5b.f608  ARPA   FastEthernet0/1
 
显示了 fastethernet 下的所有活跃主机和他们的MAC地址。- 显示的为直连或静态的MAC。 Age 为存活时间。可以使用 clear arp interface fastethernet 0/1 来清除 MAC地址。重新学习MAC
 
swtich# show ip arp fa 0/1   
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.1681.1.        0   0003.4798.7cf9  ARPA   FastEthernet0/1
Internet  192.168.1.2          -   001a.6c9d.22c1  ARPA   FastEthernet0/1
Internet  192.168.1.3        0   000e.0c31.4327  ARPA   FastEthernet0/1
Internet  192.168.1.4         0   0011.2530.afd7  ARPA   FastEthernet0/1
Internet  192.168.1.5        0  0005.5de6.f2c5  ARPA   FastEthernet0/1
Internet  192.168.1.6         0   0060.08af.737b  ARPA   FastEthernet0/1
Internet  192.168.1.7          -   001a.6c9d.22c1  ARPA   FastEthernet0/1
Internet  192.168.1.8        0   0010.5cf5.2c4e  ARPA   FastEthernet0/1
Internet  192.168.1.9         0   000f.fe5b.f608  ARPA   FastEthernet0/1
 
学不到的或是显示incomplete 的可能是有问题的。
学到机器的MAC就可以通过ping 命令测试一下。当然如果有防火墙就ping不通了。
 
switch# show mac-address-table
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0180.c200.0000    STATIC      CPU
 All    0180.c200.0001    STATIC      CPU
 All    0180.c200.0002    STATIC      CPU
 All    0180.c200.0003    STATIC      CPU
 All    0180.c200.0004    STATIC      CPU
 All    0180.c200.0005    STATIC      CPU
 All    0180.c200.0006    STATIC      CPU
 All    0180.c200.0007    STATIC      CPU
 All    0180.c200.0008    STATIC      CPU
 All    0180.c200.0010    STATIC      CPU
 All    ffff.ffff.ffff    STATIC      CPU
   1    0000.0c07.accb    DYNAMIC     Gi0/1
   1    0002.8501.de00    DYNAMIC     Gi0/1
   1    0015.f915.8e80    DYNAMIC     Gi0/1
   1    0016.7694.c009    DYNAMIC     Gi0/1
   1    0020.ed14.399c    DYNAMIC     Gi0/1
   1    0030.b637.8e10    DYNAMIC     Gi0/1
   1    0050.ba10.404a    DYNAMIC     Gi0/1
 800    0007.847b.c40a    DYNAMIC     Gi0/1
 800    00d0.d3a4.7cec    DYNAMIC     Gi0/1
 963    0006.28bb.71c0    DYNAMIC     Gi0/1
 963    00d0.d3a4.7cec    DYNAMIC     Gi0/1
 964    0000.b497.8250    DYNAMIC     Fa0/20
 964    0002.b3d8.68e7    DYNAMIC     Fa0/20
 964    0002.b3d8.6928    DYNAMIC     Fa0/20
 964    0003.a03a.03fc    DYNAMIC     Fa0/19
 964    0007.4f6a.be9d    DYNAMIC     Fa0/20
 965    0003.a03a.03fc    DYNAMIC     Fa0/19
 965    0007.4f6b.c815    DYNAMIC     Fa0/20
 966    0002.55ee.683b    DYNAMIC     Fa0/17
 966    0003.a03a.03fc    DYNAMIC     Fa0/19
 966    0009.9704.b605    DYNAMIC     Fa0/20
 974    0005.5d06.3218    DYNAMIC     Gi0/1
 974    00d0.d3a4.7cec    DYNAMIC     Gi0/1

 
static 是绑定的和系统自带的MAC地址。dynamic 是动态学到的。可是 clear mac-address-table 来清除动态的MAC 。来重新学习
 
switch(config)# mac-address-table static 1111.1111.1111 vlan 1 interface fa 0/21
 
switch# show mac-address-table interface f 0/21
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    1111.1111.1111    STATIC      Fa0/21
Total Mac Addresses for this criterion: 1
 
switch#show mac-address-table
   1    0015.585a.6066    DYNAMIC     Gi0/1
   1    0015.c6c3.821b    DYNAMIC     Gi0/1
   1    0015.f915.8e80    DYNAMIC     Gi0/1
   1    0016.413e.280a    DYNAMIC     Gi0/1
   1    0016.ec07.3b5c    DYNAMIC     Gi0/1
   1    0020.ed14.399c    DYNAMIC     Gi0/1
   1    0030.b637.8e10    DYNAMIC     Gi0/1
   1    0090.fba1.00cf    DYNAMIC     Gi0/1
   1    00d0.d3a4.7cec    DYNAMIC     Gi0/1
   1    1111.1111.1111    STATIC      Fa0/21
   1    22e0.5c14.4090    DYNAMIC     Gi0/1
 
switch(config)# no mac-address-table static 1111.1111.1111 vlan 1 interface fa 0/21
switch(config)#end
switch# show mac-address-table interface fa 0/21
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Port
----    -----------       --------    -----

show mac-address-table 是一个二层的命令。show ip arp 是一个三层命令。
如果你在一个二层接口上show ip arp 是什么也不会显示的。同样的在一个三层接口上show
mac-address-table 也是没有具体内容的。特别是在三层交换机上。有的端口可能会跑二层而有些接口跑三层。这时候寻找一个机器的MAC就需要特别注意使用那条命令了。
可以通过使用 show  vlan  和 show ip int br 或是 show run 看是不是有 no switchport 配置。