Skip to main content
3 of 4
Typos + add advantages
Morgan Courbet
  • 3.7k
  • 3
  • 23
  • 38

A solution would be to configure a DHCP static lease, if your router allows it. I like this solution because:

  • I can set all of my connected devices' IP address and DNS configuration in a unique place.
  • The Raspberry Pi won't get a taken IP address
  • I can bring my Raspberry Pi to a friend's place without reconfigure it
  • I can have multiple OS on the Raspberry Pi without configure them
  • I can reinstall the OS without reconfigure it

To configure a DHCP static lease:

  1. In a terminal on the Raspi, run the ifconfig command to know its MAC address (HWaddr XX:XX:XX:XX:XX:XX).
  2. Open your favorite browser and enter your router's IP address. Probably 192.168.0.1 or 192.168.1.1.
  3. Look for the DHCP static lease option. In the example here, the "DCHP Reservation" button.
  4. Enter the MAC address you picked up in the first point and associate it with the IP address you want to. Click here to see an example of the web interface.
  5. Restart the RPi to make it get the IP address you just set up.
Morgan Courbet
  • 3.7k
  • 3
  • 23
  • 38