0

I've connected my Linux PC to another Linux PC through LAN. Is there any way to find out the IP address of that computer without logging into it?

I've set my ip manually 192.168.7.12 and I don't know the ip range of that computer.

2

If you know the hostname of the Linux PC

From the terminal window, type the following command followed by Enter. (Where hostname is replaced with the hostname of the computer.

ping hostname

If you don't know the hostname of the Linux PC

  1. Install arp-scan by typing the following command in a terminal window followed by Enter.

     sudo apt-get install arp-scan
    

    NOTE: This may differ depending on the linux distribution.

  2. Type the following command, followed by Enter:

     sudo arp-scan --interface=eth0 --localnet
    

    NOTE: The interface may vary depending on your setup.

  3. You will be given a list of IP addresses on your local network as well as the MAC address and vendor details.

Source: Arp-scan User Guide (subheading Discovering all hosts on the local network)

2
  • thanks, but what if i don't know the range of ip of that computer? e.g if my ip is 192.168.7.12 but it maybe 42.10.0.1 or any other things?
    – abdolahS
    Aug 14 '17 at 6:11
  • I'm fairly sure that arp-scan will detect all hosts on the local network. Have you used the command and was it unsuccessful?
    – Ashton
    Aug 14 '17 at 6:19
0

if that's wlan connection,try one of these following commands ip monitor;wpa_cli -i (wlan interface name here) status;arp.If that's adhoc,you can also use wpa_cli but use interface p2p instead of wlan,it's usually named as wlan0,p2p,wlan1,wlp2s0 or p2p-dev-wlp2s0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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