I'm finding as my wlan0 inet adr on my pi when I use "ifconfig" or "hostname -I" in the command line. That's clearly the wrong IP, and it doesn't work for setting up SSH.

I'm running Raspbian, and using a wifi dongle that is connected to the internet.

Perhaps related, I can't figure out how to find whether the network is configured to DHCP or statice, nor how to set it to DHCP.

How do I get my pi's actual IP address?

  • 3
    That's clearly the wrong IP - why? what is the IP of your router (or whatever DHCP device you have in your local network) - you pi's actual IP address is whatever ifconfig tells you it is ... it doesn't work for setting up SSH - have you enabled SSH on the pi? – Jaromanda X Apr 11 '18 at 1:51

I guess you've been assigned that IP address by the (Raspbian) system because it's not getting a proper address from a DHCP server; if so, that clearly makes it your actual IP address! If you can't "figure out" how the network is configured, I'll guess it's not your network :) I'll also guess that whoever set it up knew what they were doing, and has configured a proper DHCP server for it. If I guess all of this correctly, then once you set up your RPi correctly, you'll get an IP address from the network's DHCP server that will actually route on the network, and you'll be able to access network services.

  1. scan for available wifi nets: sudo iwlist wlan0 scan
  2. edit your /etc/wpa_supplicant/wpa_supplicant.conf file to reflect the SSID name and password for the network you're authorized to use
  3. reboot & run ifconfig again to verify
  • iwlist and ifconfig are deprecated. Better use up to date tools sudo iw dev wlan0 scan and ip addr. – Ingo Apr 11 '18 at 18:03
  • you mean iproute2 for ifconfig? Linux is the only one doing that... hard to believe ifconfig will just fade away. But I've seen nothing about iwlist being deprecated (unless that's incl in iproute2) – Seamus Apr 12 '18 at 2:45
  • This isn't the place for discussing this. Here are some pointers for the questioner. He may decide if he want to stay on old stuff or like to look forward. Should I quit using Ifconfig?, quote apt show iw: "In the future iw will become the canonical command line tool for wireless configuration and iwconfig/wireless-tools will no longer be required. See /usr/share/doc/iw/README.Debian for a more detailed overview of iw." – Ingo Apr 12 '18 at 8:39
  • Dude - you brought it up - not me. – Seamus Apr 12 '18 at 12:54

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.