根据IP地址查找所属的交换机端口(交换机查找ip所在端口)

小编:芯水 更新时间:2022-09-17


//以cisco为例,在核心交换机上查询,我电脑的ip 192.168.12.28
cisoc switch#show ip arp 192.168.12.28
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.12.28 0 000d.88f7.567a ARPA Vlan11
//查到我电脑的mac 地址000d.88f7.567a, ,用cmd--ipconfig/all确认Physical Address. . . . . . . . . : 00-0D-88-F7-56-7A
//其mac地址是正确的。
//再用mac地址查询,边缘交换机接在核心交换机的哪个端口,如下为4/10口
cisoc switch#show mac-add | in 000d.88f7.567a
11 000d.88f7.567a dynamic ip GigabitEthernet4/10
//在核心交换机上查询详细资料,发现连接4/10口的交换机的ip是192.168.1.2
cisco switch#show cdp neighbors detail
Device ID: description about device
Entry address(es):
IP address: 192.168.1.2
Platform: cisco WS-C2960-48TC-L, Capabilities: Switch IGMP
Interface: GigabitEthernet4/10, Port ID (outgoing port): GigabitEthernet0/2
Holdtime : 170 sec
//telnet 192.168.1.2,查到Mac地址为000d.88f7.567a 是接在0/25端口
cisco switch2#show mac address-table address 000d.88f7.567a
Mac Address Table
-------------------------------------------

Vlan Mac Address Type Ports
---- ----------- -------- -----
11 000d.88f7.567a DYNAMIC Fa0/25
Total Mac Addresses for this criterion: 1