Raspberry Pi & Static IP address

Here’s how to set a static IP address on Raspbian without going crazy!

In this tutorial we will show you how to set a static IP address on your Raspberry Pi.
Raspberry Pi - Caronte Consulting

The old method: edit /etc/network/interfaces

Let’s start by saying that in the new releases of Raspbian (from 2016-2-09 onwards) the method of setting static IP addresses by editing the file /etc/network/interfaces is no longer working.

The new method: change the file /etc/dhcpcd.conf

Edit the following file:
				
					sudo pico /etc/dhcpcd.conf
				
			
Go to the end of the file and add the following lines:(to set a static IP on the Ethernet)
				
					interface eth0
static ip_address=192.168.1.10/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
				
			
(to set the static ip on WiFi)
				
					interface wlan0
static ip_address=192.168.1.10/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
				
			
Exit the editor by pressing CTRL+X.Save the changes by pressing Y and then ENTER.Reboot your Raspberry Pi:
				
					sudo reboot
				
			

DO YOU WANT OUR CONSULTING?

GET IN TOUCH WITH US, LET’S TALK TOGETHERE!
PHONE
EMAIL
MESSENGER
WHATSAPP

Discover some of our products

Caronte Consulting designs and manufactures hardware and software systems in the field of Industry 4.0, equipped with a sophisticated and effective artificial intelligence.Our devices are made to measure to the customer’s needs and make it possible to completely automate industrial processes, optimizing production and creating a saving of raw materials and energy consumption.
Credits for images: multiplexer.