查看某个ip地址接在交换机的哪个接口

时间:2024-02-24 12:13:53

show ip interface brief

1、如果交换机上没有做VLAN 可以直接使用:show arp

 

MPG3560#sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.16.254.21          228   1cdf.0fdd.1c04  ARPA   GigabitEthernet0/9
Internet  10.16.254.22            -   fcfb.fbc8.7ec9  ARPA   GigabitEthernet0/9
Internet  10.96.166.1             -   fcfb.fbc8.7ec5  ARPA   GigabitEthernet0/5
Internet  10.96.166.2             0   0007.baac.52fb  ARPA   GigabitEthernet0/5

 

2、如果交换机上做了VLAN,接口是处于VLAN下,show arp 中显示的接口都是vlan的名字。这时需要通过 show arp 先查出mac地址(如查出一个MAC为 b897.5a96.931c ),然后使用 show mac-address-table | in b897.5a96.931c  就可以看到其所在的接口

 

hotline_3560#sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.96.112          5   c89c.dca3.e77c  ARPA   Vlan1
Internet  192.168.96.113          0   b897.5a96.931c  ARPA   Vlan1  <--查这个IP在哪个接口
Internet  192.168.96.117         33   0021.9b09.7849  ARPA   Vlan1

hotline_3560#sh mac-address-table | in b897.5a96.931c
1    b897.5a96.931c    DYNAMIC     Fa0/13