2

I have a raspberry PI 3B. When I connect it via LAN, the ifconfig on UBuntu does not show any IPv4 address (Just IPv6). What should I do to find the correct IP range of my RPi? (and then use nmap to find exact IP and finally connect via SSH)

(Sadly I don't have any display to tweak with raspbian GUI!)

3

This might not be "the best" solution, but it works:

If you haven't configured a static IP address and in the absence of a DHCP server, your Raspberry Pi will have a self assigned link-local IP-address in the range of 169.254.1.0 to 169.254.254.255.

If the Ethernet interface on your Ubuntu machine did not self assign a link-local IP-address, you can set it yourself in the same subnet as the Raspberry Pi, e.g. by (change eth0 to the name of your interface)

sudo ifconfig eth0 169.254.10.10

Now you can ping for your Raspberry Pi, which will also report the IP-address of your Raspberry Pi

ping raspberrypi.local

Alternatively you can directly ssh into your Raspberry Pi

ssh pi@raspberrypi.local

If the raspberrypi.local addressing does not work, you can search for the IP-address with arp-scan (you might have to install it first):

sudo arp-scan --interface=eth0 169.254.0.0/16
| improve this answer | |
  • 1
    Attempting to assign a Link-local address is futile! – Milliways Nov 10 '18 at 22:01
  • I am not saying this is the best way to go. But technically it works without problems both in Raspbian and Ubuntu using ifconfig. – oh.dae.su Nov 10 '18 at 23:00
  • 1
    It is futile, because the link ALREADY has a Link-local address (this is an essential part of the address resolution protocols) and works DESPITE attempts to assign a new one. – Milliways Nov 10 '18 at 23:28
1

ifconfig is deprecated. On your pi issue the following command to determine the details of your addressing:

ip addr list

This will show both IPv4 and IPv6 addressing details:

ip addr list output

HTH- Terrence

| improve this answer | |

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.