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.
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 192.168.0.71 1698240 dhcp-snooping 1 GigabitEthernet1/0/9 00:xx:xx:xx:xx:xx 192.168.0.66 1698241 dhcp-snooping 1 GigabitEthernet1/0/3 18:xx:xx:xx:xx:xx 10.0.0.240 17364 dhcp-snooping 2 GigabitEthernet1/0/36 20:xx:xx:xx:xx:xx 10.0.0.124 4429 dhcp-snooping 2 GigabitEthernet1/0/36 00:xx:xx:xx:xx:xx 192.168.0.65 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 192.168.0.0/24, then you scan the entire range 192.168.0.1-192.168.1.254 (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.