rss logo

How to know the ip address of the device connected to a physical interface

Cisco logo

We will see here how to make the correspondence between the ip address of a device and the physical interface of a cisco switch.

Network Architecture

Let's say we have this very simple architecture and that we want to retrieve the ip addresses connected to Gi1/0/1 and Gi1/0/2 interfaces.

Cisco | Retrieve ip

Map addresses ip to physical ports

Set ip address to switch

Addresses needs to be in the same vlan as the devices we want to map.
  • Configure vlan 1 interface :
switch01(config)# interface vlan 1 switch01(config-if)# ip address 192.168.1.1 255.255.255.0 switch01(config-if)# no shutdown

Get mac addresses

As explained before (switches are Layer 2 devices), there is no way to retrieve directly this information, we first need to get the mac addresses.

So let's see how to retrieve mac addresses connected to this two physical ports.

  • Get Gi1/0/1 mac address :
switch01# show mac address-table | include Gi1/0/1 1 24b6.fd14.0853 DYNAMIC Gi1/0/1
  • Get Gi1/0/2 mac address :
switch01# show mac address-table | include Gi1/0/2 1 f8db.8845.ef15 DYNAMIC Gi1/0/2
  • Note the informations retrieved :
Interface mac address ip address
Gi1/0/1 24b6.fd14.0853 -
Gi1/0/2 f8db.8845.ef15 -

Get ip addresses

  • Ping ip addresses you want to retrieve in order to populate arp table :
switch01# ping 192.168.1.200 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.200, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/51/74 ms switch01# ping 192.168.1.210 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.210, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 33/48/71 ms
  • Show arp table to match ip address with mac address :
switch01# show arp | include 24b6.fd14.0853 Internet 192.168.1.210 0 24b6.fd14.0853 ARPA Vlan1 switch01# show arp | include f8db.8845.ef15 Internet 192.168.1.200 0 f8db.8845.ef15 ARPA Vlan1

We can now deduce from this information that 192.168.1.210 device is connected to Gi1/0/1 and 192.168.1.200 device is connected to Gi1/0/2.

Interface mac address ip address
Gi1/0/1 24b6.fd14.0853 192.168.1.210
Gi1/0/2 f8db.8845.ef15 192.168.1.200
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address