To find a laptop connected to your router via a LAN cable and determine its IP address, you can use several methods. Here’s a step-by-step guide for Linux:


1. Check the Router’s Client List

The easiest way is to log into your router’s web interface:

  1. Open a browser and go to your router’s IP address (e.g., 192.168.1.1 or 192.168.0.1). You can usually find this in your router’s manual or by checking the default gateway with the ip r command.
    ip r
    
    Look for a line like:
    default via 192.168.1.1 dev eth0
    
    Here, 192.168.1.1 is your router’s IP address.
  2. Log in to the router’s admin panel (you may need the username/password; often on the router itself).
  3. Navigate to the DHCP client list or Connected Devices section to see all devices connected to the router. Look for the laptop’s hostname or MAC address to identify it.

2. Use arp-scan to Scan the Network

If you can’t access the router, you can scan the network using a tool like arp-scan:

  1. Install arp-scan:

    sudo apt install arp-scan
    
  2. Run the scan:

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

    Replace eth0 with your actual network interface (you can check it with ip link). The output will list all devices connected to your network, along with their IP addresses and MAC addresses.

    Example output:

    192.168.1.100   aa:bb:cc:dd:ee:ff   LaptopVendorName
    

3. Use the ping and arp Commands

You can try identifying active devices on your network using a combination of ping and arp:

  1. Ping the network range:
    ping -c 1 192.168.1.1
    
    Replace 192.168.1.1 with the IP address of your router. This will populate your ARP cache with active devices.
  2. Check the ARP cache:
    arp -a
    
    This will show a list of IP addresses and MAC addresses on the network. Look for the MAC address of the laptop (often labeled on the laptop itself).

4. Use nmap for Network Scanning

Another tool is nmap:

  1. Install nmap:

    sudo apt install nmap
    
  2. Scan your network:

    sudo nmap -sn 192.168.1.0/24
    

    Replace 192.168.1.0/24 with your subnet. This will show all live hosts on your network.

    Example output:

    Nmap scan report for 192.168.1.101
    Host is up (0.0012s latency).
    MAC Address: AA:BB:CC:DD:EE:FF (LaptopVendorName)
    

5. Check the Laptop’s MAC Address

If you know the MAC address of the laptop (often printed on a sticker or available in the laptop’s OS), match it with the MAC addresses you find using any of the methods above.


Once you have the laptop’s IP address, you can connect to it via SSH (if SSH is enabled on the laptop):

ssh username@<IP_ADDRESS>

Let me know if you need help with any specific step!