Raspberry Pi Tips

Configure static IP address to RaspPi

Raspberry Pi 3 Model B V1.2

  $ cat /etc/debian_version

1: Login to router and confirm the range of IP address

Check your router's DHCP server function and the range of assigned IP address. Note that you need to assign static addres outside of this range.

Note that router has a specific list that eliminate assigning the DHCP address. Also, new static IP address should not duplicated to pre-defined IP address.

2: Check /etc/dhcpcd.conf and configure it

At the setting of /etc/network/interfaces, there is suggestions saying "For static IP, consult /etc/dhcpcd.conf" and "man dhcpcd.conf"

  $ man /etc/hhcpd.conf
  # Example static IP configuration: 
  #interface eth0 
  #static   p_ad‐dress=               
  #static   ip6_ad‐dress=fd51:42f8:caae:d92e::ff/64    
  #static   routers=
  #static   domain_name_servers= fd51:42f8:caae:d92e::1

Before udpate /etc/dhcpcd.conf, I backed up the file

$ sudo cp -p /etc/dhcpcd.conf /etc/dhcpcd.conf.bk

In my local environment at home, I configred Wifi IP address as follows

$ sudo vi /etc/dhcpcd.conf
interface wlan0
static ip_address=
static routers=
static domain_name_servers=

3: Restart Raspberry Pi

$ sudo shutdown -r now