show ip arp命令可以得到IP地址与MAC地址的对应关系,show mac-address-table可以得到MAC地址与端口的对应关系,根据这两组对应关系,我们就可以得到IP地址与端口的对应关系。
命令总结:
1.静态绑定arp表项后,无老化时间
R2(config)#
arp 192.168.1.2
cc01.0614.0000
arpa
2.show ip arp ---查看arp表
R2#
show ip arp Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.1 1 cc00.0614.0000 ARPA FastEthernet0/0
Internet 192.168.1.2 - cc01.0614.0000 ARPA
Internet 192.168.1.3 0 cc02.0614.0000 ARPA FastEthernet0/0
Internet 192.168.1.4 1 cc03.0614.0000 ARPA FastEthernet0/0
R2#
3.
show mac-address-table ---查看mac-address-table,适用于二层接口
R1#
clear arp-cache ?
A.B.C.D IP address
interface Clear the entire ARP cache on the interface
vrf Clear entries for a VPN Routing/Forwarding instance
<cr>