Raspberry Pi no IP address?

26,598

Solution 1

You can add the IP address (until next reboot) with:

sudo ip addr add 192.168.0.100/32 dev eth0

Solution 2

Configure your inet on the Raspberry Pi for auto (DHCP). Then, assign a fixed IP address to the Raspberry Pi using your router. That's very convenient and when considering the default configuration of the Raspberry Pi then you don't have to modify anything.

The appropriate line in /etc/network/inferfaces is:

iface eth0 inet dhcp

Regarding the router configuration: That's up to your device, but the manual should cover it.

Solution 3

You can also give your Raspberry Pi an IP address by adding 'ip = 192.168.0.4' at the end of cmdline.txt

Do that using the command:

sudo nano /boot/cmdline.txt

Make sure you add nothing else, not even a space or a return. After that, reboot your Raspberry Pi and type hostname -I to see if the IP address is set.

Share:
26,598
Slidon
Author by

Slidon

I am a student game developer and programmer as part of Hunter Gatherer Games.

Updated on January 29, 2021

Comments

  • Slidon
    Slidon about 3 years

    I want to transfer some files from my Mac to my Raspberry Pi via SSH, but when I try to find the Raspberry Pi's IP address with the ifconfig command in the lx terminal, the line which everyone says tells you the IP address is not there!, it's just gone. My terminal looks like this:

          eth0      Link encap:Ethernet  HWaddr b8:27:eb:63:40:b8
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27224 errors:0 dropped:0 overruns:0 frame:0
          TX packets:733 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2801074 (2.6 MiB)  TX bytes:107019 (104.5 KiB)
    
          lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    

    Because this is not from my actual Raspberry Pi, please don't make deductions from it. It's just since I can't transfer files from the Raspberry Pi I can't get a copy of the actual text.

    Sorry for the code mess up, it looks exactly like this website: http://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/finding-your-pis-ip-address

    Except without line 2 in ethO.

  • Slidon
    Slidon almost 10 years
    Thanks for this, actually I have been in need of this for a while, will add it and see what happens :)
  • Dead-coder
    Dead-coder almost 10 years
    Cool.. No problem.. Hope it helps!