Cisco交换机通过IP找端口

   日期:2017-03-13

1、通过IP查mac 
ping 10.65.156.21
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.65.156.21, timeout is 2 seconds:
.....
 
sh arp | include 10.65.156.21
 
Internet 10.65.156.21 1 000c.2946.959f ARPA Vlan1 
 
通过上面显示内容可知10.65.156.21所对应的mac为000c.2946.959f 
 
2、通过mac地址查端口 
 
sh mac-address-table address 000c.2946.959f 
 
Vlan Mac Address Type Ports 
 
---- ----------- -------- ----- 
 
1 000c.2946.959f DYNAMIC Gi1/0/11 
 
通过上面结果可知000c.2946.959f 对应的端口是GIG1/0/11 
 
即10.65.156.21 所对应的端口为GIG1/0/11