思路:已知一个路由器上的ip(192.168.1.x)则使用ip使用扫描工具查ip对应的mac地址,顺便看看网关mac地址,若是交换机上的ip地址跳过上面路由器的步骤,然后进行查找(可以是ip 查找也可以是mac地址查找),如果查询不到,使用网关进行查找,再然后查看mac地址对应的交换机接口。
华为交换机根据已知一个IP查他对应的MAC地址,已知终端ip:192.168.1.11
1.首先在核心交换机上dis arp | include 192.168.1.11
显示
IP ADDRESS MAC ADDRESS E XPIRE(M) TYPE INTERFACE VPN-INSTANCE VLAN
192.168.1.11 6xxx-9xxx-fxxx 12 D-0 GE0/0/11
Total:113 Dynamic:196 Static:0 Interface:4
找到ip:192.168.1.11对应mac地址为6xxx-9xxx-fxxx
查哪些IP已绑定的对应该的MAC地址
display current-configuration | include 192.168.1
显示dhcp server static-bind ip-address 192.168.1.9 mac-address xxxx-xxxx-xxxx
dhcp server static-bind ip-address 192.168.1.108 mac-address xxxx-xxxx-xxxx
dhcp server static-bind ip-address 192.168.1.149 mac-address xxxx-xxxx-xxxx
2.然后找到对应接入层交换机dis mac-address 6xxx-9xxx-fxxx
[ACCESS]dis mac-address 6xxx-9xxx-fxxx
MAC Address VLAN/VSI/BD Learned-From Type
6xxx-9xxx-fxxx 16/-/- GE0/0/18 dynamic
找到mac地址:6xxx-9xxx-fxxx对应端口号GE0/0/18
查看接口对应有哪些mac地址
dis mac-address g0/0/23
MAC Address VLAN/VSI/BD Learned-From Type
3d9c-232d-091a 16/-/- GE0/0/23 dynamic