can i check the ip of the machine attached with the network switch port from the switch console? I just wanted to get the IP address of all the attached devices by running a simple command in switch console.

  • maybe, it depends of the switch capabilities, adding the switch model would help to answer your question.
    – JFL
    Commented Feb 20, 2017 at 8:04
  • No specific model... It was just thought
    – Anil
    Commented Feb 20, 2017 at 8:08
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 16, 2017 at 22:03

3 Answers 3


This would entirely depend on the capabilities of the device and how it is configured.

The simplest way would be is if the device in question was configured for DHCP snooping/IP source guard. This will create a binding table on the switch that should be easily queried. As an example:

 HOSTNAME#show ip dhcp snooping binding 
 MacAddress          IpAddress        Lease(sec)  Type           VLAN  Interface
 ------------------  ---------------  ----------  -------------  ----  --------------------
 00:xx:xx:xx:xx:xx    1698240     dhcp-snooping   1     GigabitEthernet1/0/9
 00:xx:xx:xx:xx:xx    1698241     dhcp-snooping   1     GigabitEthernet1/0/3
 18:xx:xx:xx:xx:xx      17364       dhcp-snooping   2     GigabitEthernet1/0/36
 20:xx:xx:xx:xx:xx      4429        dhcp-snooping   2     GigabitEthernet1/0/36
 00:xx:xx:xx:xx:xx    1698240     dhcp-snooping   1     GigabitEthernet1/0/5

If the switch is a L3 switch and the gateway for the attached devices, most of the information should be present in the MAC address table and the ARP table on the switch, but this will take some correlation of data on your part.

If the switch is not the gateway for the attached devices, but still has L3 capabilities that are part of the same VLAN as the attached devices, then you may be able to use ping (or better yet arping if available) to learn the IP addresses in the ARP table. Again you would have to correlate data with the MAC address table.

If you have none of the above, then you would need to take the MAC address table from the switch and correlate it with data from another source (ARP table on the gateway device, another station that does an arping sweep of the subnet, etc).

Of course, it will likely be better to configure some sort of management/monitoring solution before hand that can collect/correlate information for you and provide a history of connected devices. This information can be helpful in many different situations and will give you a common point to query such information.


In the general case, you can't find directly the IP address of the attached device.

What you can find is the MAC address of the device, by looking at the switch mac address table. This table list the mac addresses associated with each port.

Then you have to map the mac address with the IP address.

A way to do it is to scan the entire network. For example your network is, then you scan the entire range (there's various tool to do so, like NMAP).

Once scanned, you look at the arp table of the scanning machine (if this machine is within the network) or the router (if the scanning machine is outside the network).

The arp table will give you the mapping between IP addresses and MAC addresses.


Use the arp table . Which show you ip address of attached machine against the Mac-address or you can check ip address of dynamic entry at physical interface where machine has connected

  • Layer-2 switches don't have ARP tables or use ARP. ARP resolves a layer-3 (IP) address to a layer-2 (MAC) address, but layer-2 switches know nothing about layer-3. Switches maintain MAC address tables that resolve a MAC address to the switch interface on which it was seen, but not the layer-3 address.
    – Ron Maupin
    Commented Feb 20, 2017 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.