How to set up Static IP on your Raspberry Pi for beginners 2022

This guide will show you how to set up Static IP on your Raspberry Pi. If you are newbie to just simply can’t remember what is the right way to do the basic network configuration on Raspberry OS you are in the right place.
 
This post is also part of miniseries on how to quickly set up fully functioning Foundry VTT on your Raspberry Pi.
 
This tutorial will show you how to switch from DHCP to Static network address.
 

Steps:

  • Log in to your Raspberry Pi 
  • Check your current IP address with command hostname -I

				
					hostname -I
				
			
  • To change network configuration edit file /etc/dhcpcd.conf with your preffered text editor.
				
					sudo nano /etc/dhcpcd.conf
				
			

You can see bunch of different settings here, basicly every line that starts with hashtag is a commentary and not taken in account.

We are looking for the section named “Example static IP configuration”.
We’ll uncomment these lines by deleting hashtags at the beginning of the line and create our configuration in here.

				
					interface wlan0
static ip_address=10.0.0.101/24
static routers=10.0.0.138
static domain_name_server=10.0.0.138 8.8.8.8
				
			

Set your ip address, routers and dns servers here according to your network setup. These numbers are good bet, but only ilustration.

    • wlan0 is the default wifi interface of Raspberry Pi, if you want to use default interface for ethernet (cable connection) use interface name eth0
    •  ip_address is address you want to assign to your Raspberry Pi
    • routers is address of your network router
    • domain_name_server are space delimetered dns servers you want to use for your Pi

 

  • Save the file and exit.
  • The quickiest way to for our Raspberry to use all new settings is to restart networking or to reboot whole Raspberry Pi.
				
					sudo reboot
# or
sudo service networking restart
				
			

After reboot connect to Raspberry Pi with network name (for example pi.local) or new assigned IP address. The case in this tutorial 10.0.0.101

Check new IP address:

				
					hostname -I
				
			

If this post helped you in any way please check out my YouTube channel for more guides and videos. 

 
Share the Post:

Related Posts