我在配置了端口安全和粘性选项的交换机上有一个端口。
interface FastEthernet0/18
...
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address sticky 78e7.d1b4.8e14
switchport port-security mac-address sticky 0060.b955.c003 vlan voice
...
end
IP 电话不再连接到此端口。如果我在端口上显示 MAC 地址,则会显示两个地址。
#show mac address-table int fa0/18
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
491 0060.b955.c003 STATIC Fa0/18
413 78e7.d1b4.8e14 STATIC Fa0/18
Total Mac Addresses for this criterion: 2
如何仅查看活动 MAC 地址,而不包括不再存在的粘性地址?show mac address-table dynamic不显示那个仍然在那里,因为它现在是static由于被粘滞语句记录了。
通过active,我的意思是设备仍然连接并在该端口上发送数据包 - 而不是仍然被记录为粘性 mac 地址。
例如,Netdisco 在执行macsuck操作时以某种方式能够分辨出差异:
select mac, port, active from node where port = 'FastEthernet0/18';
mac port active
78:e7:d1:b4:8e:14 FastEthernet0/18 true
00:60:b9:55:c0:03 FastEthernet0/18 false