How to Set a Static IP Address on Raspberry Pi
Make sure your Pi has the same IP every time you boot.

If you're trying to access a Raspberry Pi on your local network, there are times when you'll really need its IP address. Sure, you can usually SSH or VNC into a Pi by using its hostname, but for something like port forwarding on a router (which you'll use to create an externally-accessible Minecraft server or web server), an actual IP v4 address may be needed. The problem: every time you reboot your Pi, the IP address can change, based on what the router decides to assign at the moment.
Fortunately, there's a simple way to make sure that your Raspberry Pi always gets the same IP address on your local network or, at least, always tries to get the same address on your local network. It almost goes without saying that if, at the time it boots, another device that's powered on is already using the address in question, your Pi will either have no IP v4 address at all or (if you configured it as such) it will choose an alternative one. So keep that in mind.
Note that this tutorial assumes you already have a Raspberry Pi that's connected to your network. If not, please see our tutorials on how to set up a Raspberry Pi and how to set up a headless Raspberry Pi (no monitor required).

How to Assign a Static IP to a Raspberry Pi
1. Determine your Raspberry PI's current IP v4 address if you don't already know it. The easiest way to do this is by using the hostname -I command at the command prompt. If you know its hostname, you can also ping the Pi from a different computer on the network.
2. Get your router's IP address if you don't already know it. The easiest way to do this is to use the command ip r and take the address that appears after "default via."
3. Get the IP address of your DNS (domain name server) by enter the command below. This may or may not be the same as your router's IP.
Now that you have the IP address your Pi is currently using, the router's IP address and the DNS IP address, you can edit the appropriate configuration file.
4. Open /etc/dhcpcd.conf for editing in nano.
5. Add the following lines to the bottom of the file. If such lines already exist and are not commented out, remove them.
Replace the comments in brackets in the box below with the correct information. Interface will be either wlan0 for Wi-Fi or eth0 for Ethernet.
In our case, it looked like this.
You may wish to substitute "inform" for "static" on the last line. Using inform means that the Raspberry Pi will attempt to get the IP address you requested, but if it's not available, it will choose another. If you use static, it will have no IP v4 address at all if the requested one is in use.
6. Save the file by hitting CTRL + X and reboot .
From now on, upon each boot, the Pi will attempt to obtain the static ip address you requested.
Using the Raspberry Pi OS Guide to Set a Static IP
If you already have all the information about your router's IP and DNS IP, you can configure the static IP address using the Network Preferences menu instead of editing the dhcpcd.conf file.
1. Right click on the network status icon and select the Wireless & Wired Network Settings.
2. Select the appropriate interface . If you're configuring a static IP for Wi-FI, choose wlan0. For Ethernet, choose eth0.
3. Enter the IP addresses into the relevant fields. Your desired IP address will be in the IPv4 field, followed by a /24. Your router's IP and DNS server's IP will be in the fields named after them.
4. Click Apply , close the window and reboot your Pi.
Your Pi will now attempt to use your desired IP address at each boot. However, the Network Preferences menu sets this as a preference, not an absolute. So, if the IP address you asked for is not available, it will use another.
Stay on the Cutting Edge
Join the experts who read Tom's Hardware for the inside track on enthusiast PC tech news — and have for over 25 years. We'll send breaking news and in-depth reviews of CPUs, GPUs, AI, maker hardware and more straight to your inbox.

Raspberry Pi 5 4GB Versus 8GB: Pi vs Pi
Maker Creates Raspberry Pi CM5 While Waiting for Official Release
HP Spectre Foldable Review: Best Foldable, but for How Much?
- AusMatt Typo: grep "namesever" /etc/resolv.conf Should read: grep "name r sever" /etc/resolv.conf Reply
- alan tracey wootton With an Arduino that is serving a web page one can use mDns instead of keeping track of the local IP address. Add this to your Setup(): if (MDNS.begin("esp32")) { MDNS.setInstanceName("count server demo"); MDNS.addService("http", "tcp", 80); MDNS.addServiceTxt("http","tcp","counter","true"); }Then that webpage is available locally in chrome and safari as: http://esp32.local./I didn't test the other browsers. I'm sure this works for a Pi also even though I haven't tried it yet. mDns might be on by default. The url would be http:// raspberrypi .local./To check, try this command: dns-sd -B _http._tcpWhen I do that I find that both of my printers are serving http (a supply level page) in addition to the microcontroller. Reply
- wl84 When I run the nameserver command I get two results back - 192.168.11.1 and 192.168.68.1. I tried both in the config and I can't connect to anythign with either. I'm trying to setup pihole Reply
- View All 3 Comments
Most Popular
By Sammy Ekaran September 30, 2023
By Sammy Ekaran September 25, 2023
By Sammy Ekaran September 24, 2023
By Paul Alcorn September 12, 2023
By Les Pounder September 11, 2023
By Sammy Ekaran September 04, 2023
By Les Pounder August 27, 2023
By Les Pounder August 21, 2023
By Sammy Ekaran August 20, 2023
By Sammy Ekaran August 19, 2023
By Sydney Butler August 18, 2023
Set up a static IP-address on the Raspberry Pi
By default, the Raspberry Pi will get a dynamically allocated IP-address, meaning it changes as you restart it or potentially when new devices are added to the network. To make it easier to connect and have a more stable connection I recommend to set up a static IP address.
Table of contents
Get a static ip-address, setting-up using the desktop, setting-up with the terminal, prioritising internet interface, disabling static ip-address.
To get a static IP-address that works, it will need to be within the range provided by the router. We will therefore first need to find the router’s ip address. This tends to be written on the bottom of the router. If not, simply open a terminal window and type in netstat -nr . Now look under Gateway :

You can also use the command ip route | grep default | awk '{print $3}' .
In this example it is 192.168.0.1 . Using the router’s ip address we can choose a static ip address in the range between 1 and 255, which will become the last number of your ip-address, e.g. 192.168.0.40 .
Determine if you want a static ip address over WiFi or Ethernet. The interfaces are called respectively wlan0 and eth0 .
It is very simple to set up your static ethernet address. Simply right-click on the Wi-Fi icon in the menu bar (top-right on the left of the speaker icon) and select the Wireless & Wired Network Settings .
Now click the empty dropdown menu and select the network interface you want to configure. Now for IPv4 Address enter your chosen ip address, for Router the IP address of the router. AS DNS Servers add 8.8.8.8 . When wanting to add multiple DNSs make sure to add them one after another separate by a space. Finally, click the Disable IPv6 option.
One can also set up a static IP-address via the terminal. For this we need to change the dhcpcd.conf file:
Now scroll to the bottom, and add the following text:
replacing the words in capital by what is desired. Now save the file by pressing ctrl+x then y to exit.
When you are using multiple internet interfaces, such as Ethernet over Wifi, it is important to make sure the internet interface has priority over the other such that you get a working internet connection. To do so, we need to add a metric number to each, with the higher metric being prioritised first. Open the dhcpcd.conf file:
And add the metrics. For example:
Now finally reboot your Raspberry Pi for the changes to be incorporated:
Once your raspberry pi has finished restarting, connect to it locally to verify the static IP address hostname -I or ping from it on a networked computer ping YOURSTATICIP .
In many cases you may not want your Raspberry Pi set to use a static IP address. You can change the network configuration back by editing dhcpcd.conf again ( sudo nano /etc/dhcpcd.conf and removing all the lines you added in the previous steps.
How Do I Set a Static IP Address on Raspberry Pi?
If you're using your Raspberry Pi as a media or game server, setting a static IP address will make things far easier.
If you’re using your Raspberry Pi as a home server or often need to access it remotely from another device, setting a static IP address for it is a very good idea. This means you’ll be able to find it at the same Raspberry Pi static IP address every time, rather than a new address being set dynamically whenever it is rebooted. This is also useful to avoid confusion when you have multiple Raspberry Pi devices connected to your network.
Fortunately, once you know how, it's a fairly simple and quick process to set a Raspberry Pi static IP address. We’ll show you how to change the IP address in Raspberry Pi OS / Raspbian to make it permanent.
What Is an IP Address?
An Internet Protocol (IP) address is used to uniquely identify each device on a computer network, or the network itself on the internet – more on that later. The IP address is normally written in ‘dot-decimal’ notation: four decimal numbers, each ranging from 0 to 255, separated by dots. An example is 192.168.1.107 .
By default in Raspberry Pi OS, which is a Linux-based operating system, your Raspberry Pi’s IP address is reconfigured automatically each time you reboot it, so it may well change. Naturally, this is not ideal when you need a reliable address at which to connect to the Raspberry Pi from another device, such as when using it as a server. So it’s better to set a static IP address on Raspberry Pi.
Private vs. Public IP
A public IP address is used to identify your local network on the wider internet. This typically changes every time your router connects to the internet, although you may be able to make it static depending on your internet service provider.
You can find the public IP address on a Linux system such as Raspberry Pi OS by entering a special Terminal command, or simply by doing a web search for "What's my IP?". It is only required if you intend to connect to a device from outside your network, which we won’t cover here.
Instead, we are looking at the private IP addresses used to identify each device on your own local network. While it may be possible to reserve a certain IP address for your Raspberry Pi in your wireless router’s settings for the same purpose, here we’ll be showing you how to set a static IP from the Raspberry Pi itself.
1. DHCP Configuration
Raspberry Pi OS (formerly known as Raspbian) uses DHCP (Dynamic Host Configuration Protocol) to assign an IP address to the Raspberry Pi automatically whenever it is rebooted. You can find out more in our guide to DHCP .
To change Raspberry Pi OS's behavior so that it uses the same static IP address each time, you will need to modify the configuration file for the DHCP client daemon, dhcpcd.conf .
Before that, you will need some information on your current network setup so that you can add the required details to the configuration file. You will require the following info:
• Type of network connection: This is either wlan0 if your Raspberry Pi is connected to the router wirelessly, or eth0 if it’s connected using an Ethernet cable.
• Raspberry Pi’s currently assigned IP address: it’s safest to reuse this for the Raspberry Pi static IP so that you can be sure the latter hasn’t already been to another device on the network. If not, make sure another device isn't already using it.
To find the Raspberry Pi’s current IP address, enter the following command in a Terminal window:
• Your router’s gateway IP address: this is the one used to contact it from the local network, not its public IP. It varies depending on the router model, but typically starts with 192.168.
To find it, enter the following command and note the first IP address given:
• Your router’s DNS (Domain Name System) IP address: This is typically the same as its gateway address, but may be set to another value to use an alternative DNS – such as 8.8.8.8 for Google, or 1.1.1.1 for Cloudflare.
To find the current DNS IP address, enter the command:
Note the IP address after nameserver – that's the DNS address – and then press Ctrl + X to close the file.
2. Add Static IP Settings
Now you have found all your network connection information, it’s time to edit the dhcpcd.conf configuration file to add the settings you need to set up a static IP address for your Raspberry Pi:
If you haven’t edited the file previously, it will mainly contain various comment lines preceded by a hash (#) symbol. At the bottom, add the following lines, replacing the emboldened names with your own network details:
Replace the emboldened names as follows:
- NETWORK – your network connection type: eth0 (Ethernet) or wlan0 (wireless).
- STATIC_IP – the static IP address you want to set for the Raspberry Pi.
- ROUTER_IP – the gateway IP address for your router on the local network.
- DNS_IP – the DNS IP address (typically the same as your router’s gateway address).
Here is an example configuration to set the static IP to 192.168.1.120 with a wireless connection to a router at 192.168.1.254:
Once you have entered the settings, press Ctrl + X and then Y and ENTER to close and save the modified configuration file.
3. Reboot the Raspberry Pi
With the dhcpcd.conf configuration file modified, restart your Raspberry Pi to effect the changes and set the static IP address for it:
Rather than using an address assigned automatically by DHCP, the Raspberry Pi will now attempt to connect to the router using the new static IP address that you set in the dhcpcd.conf file.
To check that it is working correctly, enter the following command:
You should now see the static IP address that you set in the dhcpcd.conf configuration file.
Set a Static IP Address: Success
Congratulations: you have set up a static IP address on your Raspberry Pi, and it should now retain that address automatically whenever it boots up. Now you can go ahead and use your Pi system as a NAS, media or game server, and connect to it reliably at the same Raspberry Pi static IP address every time.
You'll Need 1
How to Configure a Static IP Address on the Raspberry Pi

What you'll need

Posted in these interests:

Raspberry Pi
The network capabilities on the Raspberry Pi make it possible to create some really fun projects. Once in a while, you’ll come across a project that could benefit from a static IP address. If you’re using your Raspberry Pi for storage as a NAS device, an FTP server—or any other kind of server for that matter—a static IP address can be a big help.
Table of Contents
1 – Update Raspberry Pi OS

This guide should work with any Raspberry Pi using Raspberry Pi OS (formerly Raspbian). Make sure your copy of is up to date. If you’re not sure where to begin, visit our guide on how to update Raspberry Pi OS .

How to Install Raspberry Pi OS on Your Raspberry Pi Get the new official Raspberry Pi OS on your Pi.
2 – Find your router IP address

We’ll need both your router IP address and name server IP. We can find this information by running a few commands in a terminal on the Pi. Remote into the Pi using SSH or open a terminal window from within Raspberry Pi OS.

How to Connect to a Raspberry Pi Remotely via SSH The preferred (and most common) method of connecting to your Pi to run commands.
To find your router IP address, enter the following command:
The router IP address will appear after the text “default via”—take note of it. The name server can be found in the resolv.conf file. Open it using the following command.
Take note of the name server IP address and close the file with CTRL + X .
3 – Edit the dhcpcd file on the Raspberry Pi

The static IP is set by adding it to a file on the Raspberry Pi. In the terminal window, run the following command to edit the dhcpcd.conf file.
4 – Set the static IP address

This document has a few lines of code that can be activated by removing the # to the left of each line. Use the following ledger to properly set your static IP address.
- Network = If you’re using a wired connection, set this to eth0 . If you’re using a wireless connection, set this to wlan0 .
- Static_IP = This is the static IP address you want to assign to the Raspberry Pi.
- Router_IP = This is the IP address for the router.
- Name_Server = This is the name server address. You can use another DNS IP here if you’d like.
Enter your information into the file, be sure to remove the <> brackets. Check the screenshot for an example.
When that’s completed, save the file using CTRL + X .
5 – Test the static IP address
When the changes have been made, restart the Raspberry Pi. Now is a good time to test your project and make sure the IP address isn’t changing. Disconnect and reconnect your Pi from the network. If the IP address changes, verify the information in the previous step saved properly. If it stays the same, congratulations! You’ve set a static IP on the Raspberry Pi.
RetroPie scrapers: what they are and how to use them

You’ve put so much work into setting up RetroPie or EmulationStation. You load it up with legally obtained ROMs only to find that custom theme you installed—you remember, the one from my RetroPie themes guide—has a big blank spot for box art! The Best RetroPie Themes (And How to Install Them)You deserve some personal flair! RetroPie: Build Your
In these interests
Raspberry pi pi • 89 guides, share this guide.
401 guides
Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.
Related to this guide:
You’ve put so much work into setting up RetroPie or EmulationStation. You load it up

Power Your Raspberry Pi Zero with a Battery Using the JuiceBox Zero
The Raspberry Pi Zero is an incredible tool for building a wide variety of IoT devices. And until la

How do I connect my Raspberry Pi to my computer?
There are many reasons you may want to connect your Raspberry Pi to your computer, and there are a f

How to Set Up Homebridge on a Raspberry Pi
Home automation is growing in popularity, but one of the biggest hurdles is compatibility betwe

Build Your Own Raspberry Pi Car Computer, or “Carputer”, with AutoPi
Have you ever wanted to add an entertainment system to your car, only to find that most units are ex

The Best Raspberry Pi HATs for Your Next Project (2022)
There are so many cool HAT extensions for the Raspberry Pi to make your next project literally sing

How to Choose the Best Camera for OctoPrint (including USB)
OctoPrint is a platform designed for the Raspberry Pi that makes it possible to monitor and control

Gamepad Zero: A Raspberry Pi Retro Gaming Rig Inside an Original NES Controller
What’s cooler than running all your favorite emulated games on a $10 computer? Putting that co

The Best RetroPie Controllers – Top 10 (2023)
If you want to play retro games on RetroPie, you need a controller. But not all controllers are crea

How to Use an LED Matrix Panel with Your Raspberry Pi
LED matrix panels are just awesome. They look retro and have the added benefit of being useful. You
Discover interesting things!
Explore Howchoo's most popular interests.
How to set a static IP address on a Raspberry Pi
The Raspberry Pi is a fine addition to your home for a crazy number of reasons, but you'll probably need a static IP for it first.

The Raspberry Pi continues to be one of the most impressive computers on the planet. Not for its power, but for the possibilities. This thing can be programmed with a mindboggling number of purposes, from small servers and NAS to controlling your home automation or even just a small Linux computer to learn some new IT skills.
Whatever you want to use it for, it's a pretty solid bet that you'll need a static IP for it. Unless you're using something like the Raspberry Pi 400 hooked up to a display, you're likely using it headless. That is, without a GUI. In the case of the Raspberry Pi Zero, this is even more likely.
Setting a static IP for your Pi is really easy, and doesn't have to involve your home router which sometimes can mess it up anyway. Case in point, the last Raspberry Pi I set up on my home network I assigned a static IP in the router settings, and it just sort of forgot about it and assigned a totally different IP to my ad blocker so it didn't actually work properly. That's why you should follow these steps and set it up on the Pi itself for the best results.
Setting up your Raspberry Pi
This guide assumes that your Raspberry Pi is already set up and you've flashed it with the Raspberry Pi OS already. If you haven't and need a helping hand, we have a guide on setting up a headless Raspberry Pi using nothing but your Windows PC.
Before you can set a static IP for your Raspberry Pi you will need to know what IP address it's currently on. At this point, the quickest method is probably to log into your router's software and grab it there, especially if you're doing a headless setup. You'll need the IP address to connect over SSH and do the rest.
With the IP address in hand, open a terminal (WSL or PowerShell is fine), and connect with the following command:
Accept the fingerprint by typing yes and hitting enter. If this is the first boot you'll need to log in with the default password, which is raspberry . It's a good idea to change this, but for the purposes of what we're doing here you don't need to and can just carry on with the next step.
How to set a static IP on your Raspberry Pi
To set the static IP properly you'll need a few things. The first is the current IP of the Pi which you've already got, the next is your router's gateway IP and the current DNS IP address. We can get these last two from the Raspberry Pi terminal.
Router gateway IP address
Enter this command into the terminal:
Note down the first IP address given as this is the one you want.
Router DNS IP address
Again in the terminal, enter this command:
This will open a file in the nano text editor and the IP address you're looking for is immediately after nameserver . Note this down and press Ctrl + X to close out.
Setting the static IP address
The final step is to set the static IP address for your Raspberry Pi. It involves appending some details to the end of a configuration file. You must make sure you either use the IP address already given to your Raspberry Pi or that you're using an address that is currently vacant.
To begin, enter this command:
This will open up the dhcpcd.conf file in the nano text editor. Use your cursor keys to navigate all the way to the bottom.
Make sure not to change any of the existing items in this file, then at the bottom, you'll be entering a block of text following this template:
You'll replace the terms in capitals with the following:
- NETWORKTYPE — Type either eth0 for ethernet or wlan0 for wireless.
- YOURSTATICIP — Whatever static IP you want to assign to the Raspberry Pi.
- YOURROUTERIP — The gateway IP address acquired above.
- YOURDNSIP — The DNS IP address acquired above.
When finished you'll end up with something that looks a bit like this:
Now, press Ctrl + X followed by Y to close and save the file. You'll need to reboot the Pi for the changes to take effect, which you can do with the
Give it a minute to reboot, reconnect over SSH, and then use the
command to confirm the IP address matches what you set above. It should match, and now your Raspberry Pi should retain this IP any time it boots. Ensure you don't assign anything to this IP address either manually or through your router settings, and you should be good to go!
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.

Richard Devine is a Managing Editor at Windows Central with over a decade of experience. A former Project Manager and long-term tech addict, he joined Mobile Nations in 2011 and has been found on Android Central and iMore as well as Windows Central. Currently, you'll find him steering the site's coverage of all manner of PC hardware and reviews. Find him on Mastodon at mstdn.social/@richdevine
- 2 The best mesh Wi-Fi system I've ever used just hit its LOWEST price on Amazon and I couldn't recommend it hard enough
- 3 I couldn't pass up this incredible 4TB portable Samsung SSD deal, and you shouldn't either
- 4 Lenovo Legion Go review: Steam Deck and ROG Ally have a worthy gaming handheld competitor
- 5 My favorite gaming chair is $100 off right now and has adjustable lumbar support without a bulky pillow

- Raspberry Pi
- DIY Electronics
- Programming
Select Page
How to Set Up a Static IP on the Raspberry Pi
Posted by Scott Campbell | Raspberry Pi | 31

Have you ever tried logging in to your Raspberry Pi via SSH and were denied because the IP address couldn’t be found? Do you have to scan your network every time you connect to find your local IP address? If the IP address of your Raspberry Pi changes all the time, it’s because you’re using a dynamic IP address . If you want your Pi to have an IP address that doesn’t change automatically, assign it a static IP address . With a static IP, you can be sure that the same IP will work each and every time.

In this tutorial, I’ll show you how to configure a static IP address using a clean installation of Raspbian Jessie and Raspbian Jessie Lite. There are pros and cons to each type of IP though, so let’s first talk about why you would want a static IP over a dynamic IP.
Static IP vs. Dynamic IP
Dynamic IP’s are good to use if you’re concerned about security. If a hacker gets access to your IP address, you’ll be less vulnerable to attack since your IP changes frequently. A dynamic IP can change every time you log in, or only at certain intervals. A program installed on your network router called the dynamic host configuration protocol (DHCP), automatically changes and assigns new dynamic IP addresses to computers on your network.
A static IP (as you could probably tell by the name) is one that doesn’t change. This makes it more reliable when using services that depend on a stable internet connection, like online gaming, VOIP, or remote desktop applications. With a static IP, you’ll be able to use the same IP address every time you connect to your Pi.
Setting up a Static IP on the Raspberry Pi
Before starting, make sure you’ve already set up and configured a way to access the command prompt. Check out our tutorials How to Set Up WiFi on the Raspberry Pi and How to Set Up a Raspberry Pi Without a Monitor or Keyboard to see how to do that if you haven’t already.
In this tutorial we’ll set up static IP’s for both WiFi and ethernet connections. If you only need one or the other, just omit the code below for the connection you don’t need.
Find Out Your Network Information
The first step is to find out your default gateway IP . This is the local IP address of your network router. The computers on your network use it to communicate with the router and access the internet. If you already know what it is, just skip this step. If not, do continue…
Power up and log into your Raspberry Pi via WiFi or ethernet, then enter route -ne at the command prompt to see your network routing information:

Under the “Gateway” column, you can see your default gateway IP (10.0.0.1 in my case). The “Iface” column lists the names for each connection – ethernet (eth0) and WiFi (wlan0). Write down your default gateway IP, we’ll need it in a minute.
Now we need to find out the IP addresses of your domain name servers. Your Pi sends the domain names you enter into your browser (i.e. www.google.com) to domain name servers, which convert the domain names to IP addresses (i.e. 8.8.8.8). Your Pi then uses the IP address to access the website’s server.
Enter cat /etc/resolv.conf at the command prompt to find the list of domain name servers:

Copy these IP addresses to a text editor on your PC or write them down for later.
Configure the Network Settings
Now we’re ready to configure the network settings. By default the Pi is configured with a dynamic IP address. To assign it a static IP address, you need to add your static IP, default gateway IP, and domain name servers to the dhcpcd.conf file.
At the command prompt, enter sudo nano /etc/dhcpcd.conf to edit the dhcpcd.conf file:

Now, without changing anything else in the file, add this code at the bottom of the dhcpcd.conf file, replacing the IP addresses with your own IP addresses found above:
- static ip_address : This is the static IP address you’ll use to SSH or remotely connect to your Pi. Take your default gateway IP (found in the steps above), and change the last number to any other number between 0 and 255.
- static routers : This is your default gateway IP address.
- static domain_name_servers : These are the IP’s we found in the resolv.conf file above. Separate each IP with a single space.
For example, my default gateway IP address is 10.0.0.1. To get the static ip_address for my ethernet connection (eth0), I replaced the 1 with 100 to get 10.0.0.100. To get the static ip_address for my WiFi connection (wlan0), I replaced the 1 with 99 to get 10.0.0.99. I’ll use these IPs to log in to my Pi from now on.
The file should look like this (with your own IP addresses):

Once you’ve replaced the IP addresses in the example code with your own IP addresses, press Ctrl-X and Y to exit and save the dhcpcd.conf file. Now enter sudo reboot to reboot the Pi. Log in with your new static ethernet IP or static WiFi IP:

To check that everything is working correctly and the Pi has access to the internet, let’s ping Google. Enter sudo ping www.google.com at the command prompt:

Press Ctrl-C to stop the pinging. If the connection is successful, you’ll see the packets that have been sent and received. If your connection isn’t successful, you will get a “Network is unreachable” error:

You should probably test the connection by pinging Google with both ethernet and WiFi static IP’s.
You can watch me set this up step by step in this video:
Now that you have a static IP set up, your Pi’s connection to the internet will be a lot more reliable. But another really useful way to connect to your Pi is with a direct ethernet connection to your laptop or desktop. A direct connection is extremely fast and stable. If you connect to your Pi via SSH a lot, I would definitely recommend setting this up. Check out our article, How to Connect to a Raspberry Pi Directly with an Ethernet Cable to learn how.
Thanks for reading! Let me know in the comments if you have any questions about setting up your static IP, and I’ll do my best to help. And be sure to subscribe! We send out a quick email each time we publish new articles.

Related Posts

How to Set Up Buttons and Switches on the Raspberry Pi
August 3, 2020

How to Send Text Messages With a Raspberry Pi
April 8, 2021

How to Use Potentiometers on the Raspberry Pi
November 26, 2020

How to Use RFID Cards with a Raspberry Pi
May 31, 2021
31 Comments
Great article. Just a few weeks too late for me as I finally figured it out…
It can be as simple. Lots of articles about fixed ip on the web, read at least 10 of them. All of them wrong or at least outdated (no jessie). Yours worked in no time. Mni thanks for that!
Thanks a Lot on How to setup static ip address, I looked few web site and most had wrong information.
Thank you, many “so called current” info on this on the web but all seem outdated, this is 100% correct. Thank you again.
works fine in setting static address but when trying to ping Google I get “unknown host http://www.google.com ” If I comment out the added lines the ping works fine I use TightVNC to connect to the PI – router address is 192.168.1.1
@JarJarGeek Very nice guide, I would use this for server, but for general Pi;s I find avahi-deamon more flexible.
When i type in the cat for either files or even sudo nano it either says that te file or directory doesn’t exist or the document comes up blank (implying that it doesn’t exist).
i am using a raspberry pi 3 and am using the latest raspbian os as of may 15th 2016.
please help that way i don’t end up having to set my pi up every time i want to use it.
nevermind. got it working.
had to share this on my @RebelMouse. Thank you! https://t.co/6mLwym7uQO
When I tried this it fails to connect. I think the problem is in the static router address. As per your instructions I came up with 0.0.0.0…
pi@VIDraspberrypi:~ $ route -ne Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
Oops… rebooted a second time and now ALL works! THANK YOU FOR WRITING (AND VIDEO RECORDING) SIMPLE, CONCISE AND UP TO DATE INSTRUCTIONS!!!!!!!!!!!
will this allow graphics from a python program running on pi like pygame? or is the screen functionality merely a window into the terminal?
How will you ensure that the DHCP won’t assign this address to another device?. If my understanding is correct the DHCP does not know about this static IP and can therefore assign it to something else. If this happens there will be an IP conflict. is there anyway out of this ?
Most dhcp servers will try to ping address before assigning it to a client. But if your static IP device is switched off, the address still may be used by dhcp, and conflict will happen when you switch it on.To avoid this, you have to exclude address from your dhcp server’s address distribution range. Or you can make a reservation for that address in dhcp. In some cases reservation is even an alternative to static IP.
How can I set network mask to? Because this way it gives me mask of 255.0.0.0 which is not correct in my case, Also I need to set additional classless route for 10.10.0.0/16 via another gateway.
In fact I don’t need static address. If I do, I’d rater prefer to setup a dhcp reservation. I came to your article finding solution to a problem I have: My raspbian jessie / pi3B does not get default gateway from DHCP. It receives normaly everything else – IP address, default domain, dns and ntp servers, additional classless routes but not default gateway! What can be wrong? The DHCP server is Windows 2012 R2, if that does mater.
With Raspian Jessie (2016/09/23) a need to add “routers” and “domain_name_servers” BOTH under eth0 and wlan0:
interface eth0 static ip_address=192.168.x.x/24 static routers=192.168.x.x static domain_name_servers=x.x.x.x
interface wlan0 static ip_address=192.168.x.x/24 static routers=192.168.x.x static domain_name_servers=x.x.x.x
Thanks for the update! I’ll add this to the post.
i share with you a video on youtube how to configure your ip from dhcp to static. https://www.youtube.com/watch?v=3uixbMXZeNs&t=4s
When i run “sudo ifdown wlan0, sudo ifup wlan0” i get “ifdown: interface wlan0, not configured”. what is the fix for this ?
Amazing! Its truly amazing article, I have got much clear idea concerning from this piece of writing.
wicd-curses
Hi, we have the products of raspberry pi and arduino components, and very interest in working with you.
How do i make it so the ip is the same on any network?? Working on a project and need a way to ping the pi on any network it goes to.
Great article, thank you so much for explaining each of the lines in the dhcpcd.conf file. so many articles tell you to “just add this” without explaining what it means and why. Led to me following several and losing SSH access to the pi until I reverted it.
Doesn’t get much easier that that. Thanks.
Thanks, confirming this worked for me using Raspbian Buster in January 2019
Thank you so much, this helped me a lot. May 2020
I have set static IP in Pi and check by ping and it is working fine but when I enter static IP in putty for ssh getting network error connection time out. I have checked SSH is enabled in pi as well. Can anyone please help me why getting this error?
Worked like a charm. Thank you!
Hello Your tutorial is really helpful. But I have a problem. It seems that I have mistype my static IP address so I can’t connect with my RPi. The static ip_address should be “192.168.1.xxx” but I typed it “192.168.201.xxx” Is there any way I could fix it? Thank you
I am having a strange issue where my resolve.conf file keeps resetting upon reboot or shutdown and I have to do the setup again!!! The requirement for the static IP is because I am running my own VPN server with OpenVPN and the client I am using on the other end for connecting is Orbot for PC. I don't want to start from scratch hence the reset is not a choice. I did try changing the user and also chmod to 775 giving full permissions or locking it down, without much luck. Any guidance is appreciated.
Leave a reply Cancel reply
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.
Notify me of follow-up comments by email.
Notify me of new posts by email.
For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use .
I agree to these terms .
Get new tutorials sent to your inbox!

Quick Start Guide for Setting Up a Static IP on the Raspberry Pi
Enter your name and email and I'll send it to your inbox:
Consent to store personal information: I agree to let Circuit Basics store my personal information so they can email me the file I requested, and agree to the Privacy Policy
Email me new tutorials and (very) occasional promotional stuff: Yes No
Check your email to get the PDF!
- Domain Names
- Domain Name Search
- Free Domain Transfer
- .com Domain
- 1 Dollar Domain
- Cheap Domain
- Free Domain
- Buy SSL Certificate
- Website Builder
- Website Platforms
- Website Templates
- Web Design Services
- eCommerce Website Builder
- Web Hosting
- WordPress Hosting
- 1 Dollar Hosting
- Windows Hosting
- Free Website Hosting
- Create Business Email
- HiDrive Cloud Storage
- Microsoft 365 Business
- Cloud Server
Your fully virtualized private server.
- Dedicated Servers
- Rent a Server
- IONOS Cloud
- Business Name Generator
- Logo Creator
- Favicon Generator
- Whois Lookup
- Website Checker
- SSL Checker
- IP Address Check
- Configuration

How to set a Raspberry Pi with a static ip address?
A static IP address , as opposed to a dynamic IP address, doesn’t change. The single-board computer Raspberry Pi always needs a static IP address if you want to access it with other devices over a long period of time. This refers to the private IP address of the Raspberry IP that is located by a computer within the local network as well as the public IP address of the network via which the Raspberry Pi is accessible on the internet (for example, if it’s being used as a server). But how do you provide Raspberry Pi with an IP address that always remains the same? This guide explains which options you have for linking a static IP address to your Raspberry Pi.
Addressing Raspberry Pi in the LAN via a private IP address
Addressing the raspberry pi on the internet via a public ip address or ddns, assign a static private ip address to raspberry pi with a router, assign a static private ip address to raspberry pi with dhcpcd, static ip addresses for raspberry pi are sometimes vital.
$1 Domain Names
Register great TLDs for less than $1 for the first year.
Why wait? Grab your favorite domain name today!
Addressing Raspberry Pi via a static IP address
For many projects with the small computer, it’s either useful or necessary to provide Raspberry Pi with a static IP address. But before we talk more specifically about the use of such a static IP address with Raspberry Pi, we’ll first outline the differences between addressing a computer in a private (local) network or on the publicly accessible internet . Private and public IP addresses are not to be confused with each other.
Within a local network (also called a Local Area Network, or LAN for short), a router distributes data to various devices. The router is also responsible for IP address assignment – more specifically, the DHCP server integrated in the router is responsible. For example, the DHCP (Dynamic Host Configuration Protocol) automatically assigns free IP addresses to the corresponding devices. Computers, smart TVs, smartphones, or a Raspberry Pi each receive such an address via which they can communicate with other devices. Therefore, all devices are uniquely identifiable via their so-called MAC address .
Since IP addresses in a private network are individually assigned by the DHCP and the coupling of devices to an IP address is only valid within your local network, here we’re talking about private IP addresses . In the default settings, Raspberry Pi also receives its IP address via the DHCP server. The private IP addresses of individual devices can change though, depending on the configuration of the DHCP server.
To be able to reach Raspberry Pi on the same address in your own LAN, you have to provide it with a static, private IP address . One such static IP address for Raspberry Pi can be used, for example, for the remote maintenance of a computer within the network protocol SSH (Secure Shell): If you have an SSH program installed, you can control the Raspberry Pi via another computer using the SSH client. This has the advantage that you don’t have to connect a monitor and input device separately for operation anymore. But if the minicomputer only has a dynamic private IP address, then you have to reselect the current IP address for every SSH access and link it to the SSH client – you bypass this step with a static private IP address.
A static private IP address is essential for your Raspberry Pi if you want to set it up as a server in the LAN . If the Raspberry Pi server is also to continue being available outside of the local network, then you have to assign it another static address via which the server can be accessed on the internet. For example, an internet connection with a static public IP address or a DDNS service.
If the Raspberry Pi is to be used as a server accessible over the internet, then the public IP address of your internet connection comes into play. Most internet access is available via dynamic IP addresses that are changed every time they start and at the latest every 24 hours. This changes the public IP address with which the Raspberry Pi server can be reached.
If you want to set up your Raspberry Pi as an ownCloud server or in another server form, the following problem occurs: As soon as the server receives a new IP address, it can only be traced in the LAN. If you want to be found outside of the local network, you no longer know which address the server can be reached on. The solution to this is a fixed IP address. The simplest variation here would be to use an internet connection with a static public IP address . But this is usually quite expensive, and isn’t offered by all internet service providers.
Another solution is the application of dynamic DNS (DDNS) . This links your dynamic public IP address with a domain name. Every time, as soon as your IP address changes, a program redirects the new address to the domain name and makes it permanently available on the internet. Now if you link a server on Raspberry Pi with the domain name, it’s permanently accessible online.
There are both free and paid DDNS services. Before you decide on one for yourself, you should first test which DDNS providers your router supports, and whether it supports any at all . Find the DDNS support tutorial for whichever individual router your DDNS server is intended to operate on, such as this tutorial for Linksys routers .
Many routers support the ability to provide individual devices within the local network with a static IP address. With a Linksys router, the Linksys app allows you to manage multiple devices and handle all of the router assignments remotely. Various other routers also support similar functions, and so can be used for linking Raspberry Pi with a static IP address.
A static IP address for Raspberry Pi is set up somewhat differently for each router. The basic principle is always the same, though: You open the user interface of the router in your browser; Link the MAC address of Raspberry Pi with your LAN’s IPv4 address via the manual IP configuration. Most of the time, a checkbox exists for this in the router interface. This enables you to always automatically use the IP address assigned to you.
Raspbian Jessie, or Jessie Lite – the current Raspbian operating systems at the moment – have a DHCP client daemon (DHCPCD) that can communicate with the DHCP servers from routers. The configuration file of a DHCP client daemon allows you to change the private IP address of a computer and set it up in the long term. The following instructions will assign a static IPv4 address with 32 bits (not to be confused with an IPv6 address , which has 128 bits available) to the Raspberry Pi.
Before you begin with the assignment of a private IP address for Raspberry Pi, check whether DHCPCD is already activated using the following command:
In case it’s not, activate DHCPCD as follows:
Now make sure that the configuration of the file /etc/network/interfaces has the original status . For this, the ‘iface’ configuration needs to be set at ‘manual’ for the interfaces.
For the editing of the activated DHCPCDs, start by opening the configuration file /etc/dhcpcd.conf and running the following command:
You’ll now carry out the configuration of the static IP address. If your Raspberry Pi is connected to the internet via an Ethernet or network cable, then enter the command ‘interface eth0’; if it takes place over Wi-Fi, then use the ‘interface wlan’ command.
To assign an IP address to Raspberry Pi, use the command ‘ static ip_address= ’ followed by the desired IPv4 address and the suffix ‘ /24 ’ (an abbreviation of the subnet mak 255.255.255.0 ). For example, if you want to link a computer with the IPv4 address 192.168.0.4 , then you need to use the command ‘static ip_address=192.168.0.4/24’. It goes without saying that the address used here is not yet used anywhere else. As such, it also can’t be located in the address pool of a DHCP server.
You still then need to specify the address of your gateway and domain name server (usually both are the router). Raspberry Pi turns to the gateway address if an IP address to which it wants to send something is outside of the subnet mask (in the example, this would mean outside of the range 192.168.0). In the following command, the IPv4 address 192.168.0.1 is used as an example as both the gateway and DNS server. The complete command looks like this in our example (where a network cable is used for the internet connection):
The command lines above match the IPv4 addresses that you want to use for your Raspberry Pi, or where your router is assigned. Save the changes with ‘Ctrl + O’ and then press the enter key. Close the configuration file with ‘Ctrl + X’. Restart to adopt the newly assigned static IP address in the network:
Now use a ping command to check whether the Raspberry Pi is accessible in the network with its new IP address:
If the connection of the IP address was successful, you’ll see that you can reach it under the new IP address with a ping.
In summary, it should be noted that there are basically two different IP addresses that are relevant for Raspberry Pi (and projects using it): the private IP address of the Raspberry Pi within the local network, and the public IP address of its internet connection.
A static private IP address is primarily necessary if you want to use Raspberry Pi as a server . But if you access the minicomputer via SSH more frequently, you should assign in a static address in the same way. The possibilities outlined above detail how this can be achieved with relatively simple means.
Assigning a fixed public address that allows your Raspberry Pi to be accessed via the internet is somewhat more complicated. This is necessary, for example, when attempting to make your server installed on Raspberry Pi remain constantly available online. Most internet access is available only via a dynamic public IP address, which isn’t possible here. Since a static address isn’t offered by all internet providers (and if it is, then it’s usually relatively expensive), a DDNS service presents the best solutions. But for this, you have to know which forms of dynamic DNS are supported by your router.
- Open Source
Related articles

Creating a Raspberry Pi cloud server with owncloud
With ownCloud software, your Raspberry Pi can be used as a private cloud, performing the same kind of tasks as clouds from major providers such as Google, Amazon, and Dropbox. Cost-effectiveness is just one of many the benefits of creating your own personal cloud; another is the privacy and security of your data. This step-by-step Raspberry Pi cloud tutorial explains how to set up ownCloud.


Raspberry Pi mail server: using Raspberry Pi to manage e-mails
Why use e-mail servers from commercial e-mails service providers when you can just set up your own? You can create a private server easily and affordably with a small computer known as Raspberry Pi. Having your own e-mail server, however, requires a certain amount of work and also has its disadvantages. You can find out more about how to set up your personal Raspberry Pi mail server in this…

Using Raspberry Pi as a web server
Have you always wanted to operate your own web server? Raspberry Pi makes this goal more realistic, without commanding a high price and expert-level knowledge for set-up: hosting a website’s test environment or a private cloud is just as manageable for the small computer as controlling light sources, heaters, or other home devices (home automation). In our tutorial, you’ll find out all you need to…

30 Raspberry Pi projects that show the possibilities of the mini computer
Raspberry Pi is an inexpensive micro-computer that can behave like a standard computer in many respects. The innovative mini device can be used for a wide range of tasks - from setting up an operating system to surfing the web, to using it as a server or a media center. Discover 30 interesting Raspberry Pi projects to try out at home.

What is DHCP Snooping?
DHCP snooping makes a network more secure. There are no two ways about it: DHCP makes network configuration so much easier. This is especially the case in large networks, where devices are constantly changing and the manual assignment of IP addresses is a never-ending task. Yet by using DHCP to simplify the process, you do relinquish controls, and criminals can take advantage of this. By using…
Build or host a website, launch a server, or store your data and more with our most popular products for less.

Home » Linux » Raspberry Pi » Raspberry Pi Static Ip
![Setting a Static IP Address on a Raspberry Pi [With Screenshots] 1 Setting a Static IP Address on a Raspberry Pi](https://cd.linuxscrew.com/wp-content/uploads/2021/01/Setting-a-Static-IP-Address-on-a-Raspberry-Pi.png)
Setting a Static IP Address on a Raspberry Pi [With Screenshots]
If you followed our article on how to SSH to your Raspberry Pi so that you can control it over a network, you might be tired of having to run the commands to find out what its current IP address is on your network.
Most networks assign IP addresses dynamically , which means each device on the network is assigned an IP address from a pool of available IP addresses. The address for a specific device may change over time if it is rebooted or the address is automatically reassigned for some reason. This is called DHCP – Dynamic Host Configuration Protocol .
Giving your Raspberry Pi a static IP address on your network means that it will always have the same address for you to connect to.
This article assumes you are running Raspberry Pi OS.
Step 1 – SSH to Your Raspberry Pi (or Attach a Screen & Keyboard)
If you don’t have a screen and keyboard attached to your Raspberry Pi, you will need to SSH to get things set up.
It’s highly recommended that you set a static IP address using a screen and keyboard just in case you make a mistake – you may not be able to reconnect if the network configuration isn’t valid.
Step 2 – Find Out Which Interface is Connected
The ip command can tell us all we need to know about the current state of the network on your Raspberry Pi.
Run the following in your terminal to see what interfaces are connected:
Which will output something that looks like this:
![Setting a Static IP Address on a Raspberry Pi [With Screenshots] 2 ip addr show](https://cd.linuxscrew.com/wp-content/uploads/2021/01/pi_static_ip-1.png)
Here you can see the connected network interfaces . Each entry in the above output represents an interface – each entry taking the format
The interface named lo is the LOOPBACK interface, used for the computer to communicate with itself. It’ll always be there on most systems.
Below is the only other connected network interface wlan0 , the wireless network connection on this Raspberry Pi. We can tell it is connected as it says UP in the block of information next to it!
If the wired ethernet connection were connected rather than the wireless, you’d see eth0 instead of wlan0 . It’s possible but unlikely on a default installation of Raspberry Pi OS that your network interfaces will have different names than those shown here.
Step 3 – Finding your Network and Gateway
You will probably want to assign your Raspberry Pi an IP address on the network it’s already connected to. To do so, we will need to know what network addresses we should use to talk to other devices already there.
Finding the Network
This current IP address assigned to your Raspberry Pi is visible in the previous step’s output.
The IP address following inet will tell you the current IP. Yours will be different but will be for a local IP address range.
To find out more about IP addresses, check out our article on IP Addresses and Subnets.
Finding the Gateway
For your Raspberry Pi to talk to the outside world, it will also need to know the address of your gateway – your internet modem/router. Run the following to do so:
This will output the current network routes configured on your system:
![Setting a Static IP Address on a Raspberry Pi [With Screenshots] 3 ip r show](https://cd.linuxscrew.com/wp-content/uploads/2021/01/pi_static_ip-2.png)
We are interested in the default route on the first line. This tells us that by default, traffic is routed via 192.167.1.254 – now we know the gateway’s address.
Finding Your DNS Servers
You will also need to know what DNS servers you are currently using (if any) if you wish to access the internet. These can be found by running:
Which will output the contents of the resolv.conf file as generated by your system.
![Setting a Static IP Address on a Raspberry Pi [With Screenshots] 4 cat /etc/resolv.conf](https://cd.linuxscrew.com/wp-content/uploads/2021/01/pi_static_ip-3.png)
Here you can see the default nameserver assigned is your router – 192.168.1.254 .
Step 4 – Finding an Available IP Address
This step is dependent on the brand and configuration of the router you have.
When DHCP assigns an IP address automatically, your router will choose one from a range of IP addresses defined in its configuration. We should not assign the Raspberry Pi a static address that falls into that range, as otherwise, it may conflict if another device receives that address automatically.
You’ll have to check your router configuration or user manual to find out what this range is so that you can make sure you avoid using an address from it.
Step 5 – Assigning the IP Address to the Connected Interface
My network has a DHCP range of 192.168.100 to 192.168.200, from which addresses will be automatically assigned, so I will assign my Raspberry Pi the address:
This is to make sure that it doesn’t conflict with an existing IP (or the router’s IP address, which is 192.168.1.254).
Assigning a Static IP Address Temporarily
To assign a static IP address until the next reboot, just run:
Replacing 192.168.1.201 with the IP address you wish to assign and wlan0 with the interface’s name to assign it to.
To find out more about IP addresses and the format they are displayed above, check out our article on IP Addresses and Subnets.
Assigning a Static IP Address Permanently
The network configuration will need to be edited to assign an address permanently. Edit the relevant configuration file by running:
The configuration file(s) which you will need to edit will differ depending on your Linux distribution – this method is tested on Raspberry Pi OS in its default state
Add the following lines to the end of the file:
- Lines beginning with # are comments and are not read as configuration entries
- interface is the name of the connected interface and tells the configuration that the configuration lines following it will be applied to that interface – for this example, it is wlan0
- static ip_address is the static IP address you wish to assign to this interface – 192.168.1.201 in this case
- static routers is the IP address of the gateway/router on your network. 192.168.1.254 is the IP address of the router for this example.
- static domain_name_servers are the DNS servers we wish to use for this network. As seen above, mine is 192.168.1.254 as my router acts as the DNS server. I’ve added a second DNS server separated from the first by a single space. 8.8.8.8 is Google’s DNS server, which will act as a second/fallback DNS server.
To apply these changes, save the document by pressing CTRL + X and pressing Y to save. Then, reboot.
Your Raspberry Pi now has a Static IP!
- Setting up a LAMP Stack on Ubuntu 20.04 (And Raspberry Pi)
- TwisterOS For Raspberry Pi Does It All [Screenshots/Review]
- How to Install Ubuntu MATE 2020.10 on a Raspberry Pi (With…
- How to Install OSMC Media Center on Raspberry Pi…

1 thought on “Setting a Static IP Address on a Raspberry Pi [With Screenshots]”
I gave this a shot on ubuntu server 20.04, adapting it a bit where needed, and I just couldn’t get it to stick between restarts. Ended up using netplan with success so far.
Either way, great guide! I had fun tinkering, and I’ll back back in a few weeks when I grab a pi.
Leave a Comment Cancel reply
Save my name, email, and website in this browser for the next time I comment.
Privacy Overview

How to Set a Static IP Address on Raspberry Pi
Set a Static IP Address on Raspberry Pi (2021)
Set a static ip address using raspberry pi’s terminal.

3. After that, execute the below command to open the dhcpcd.conf file via Nano editor. Keep in mind that Nano is a keyboard-based editor , so you can’t use your mouse to move between lines and edit the file.

8. That’s it. You have assigned a static IP address to your Raspberry Pi in a few easy steps. Now, your router will only use the static IP address you have set for your Raspberry Pi.
Using the Router Settings to Set Static IP on Raspberry Pi

4. Click on “Add” and enter the IP address of Raspberry Pi in the “Reserved IP Address” field. You can find the IP address of your RPi board by entering hostname -I in the Terminal. To find the MAC address of your RPi , scroll down and look for the client list mentioned on the same admin page. Next, give a name in the “Description” field and turn on the “Enable This Entry” checkbox. Finally, click on “Save”. It will reserve Raspberry Pi’s current IP address, making it a static IP.

Assign a Static IP Address to Raspberry Pi in a Few Easy Steps!

How to Set Up Raspberry Pi Without a PC

This Developer Built a Low-Cost Weather Station That Predicts the AQI Using a Raspberry Pi

Raspberry Pi OS 64-Bit Arrives with Improved Performance and App Compatibility

How to Safely Overclock Raspberry Pi 4

How to Install Windows 11/ 10 on Raspberry Pi

How to Build an Audio Streaming Device with Raspberry Pi
WTF… This is all WIFI! What if I have my RPi connected to my router via a 1000MHz ethernet cable? You shd be more general, and not assume everyone connects thru ther wifi.
Your Comment
Your Email *

Alan Wake 2 Review: Just The Right Kind Of Insane
Thirteen years ago, detective thriller writer Alan Wake went missing at Bright Springs, a quaint town in Washington DC. And with it, a possible sequel to his novel Departure. Thirteen years later, his sequel to Departure finally launched in the […]

OnePlus Pad Go Review: All-Rounder Budget Tablet
With the tablet market reaching saturation, there are not exactly a whole lot of reliable options to go for in the budget category. More so, if you are looking for a tablet that can provide a good multimedia experience, can […]

14th Gen Intel Core i9-14900K Review: Incremental Upgrade!
Intel has launched the 14th Gen Core i9-14900K, aimed to be one of the fastest processors available for desktop platforms. This brand new i9-14900K is the best processor Intel offers in its new lineup, and we took an exciting ride […]

Recent Posts

How to set a static IP address on a Raspberry Pi
Raspberry Pi's are getting faster and can do more things in your house than ever before. If you've ever tried to set up a service on your Raspberry Pi, you know that one of the most important things you need for everything to work is the IP address of your Raspberry Pi. If you don't use static IP addresses for your services, the IP will reset after every reboot of the credit card-sized computer. This could make it so your services are no longer reachable and you have to go out of your way to update the new IP address in all places that you set it before. But luckily there is a very easy solution to avoid this situation: a static IP address.
Setting a static IP on a Raspberry Pi has a lot of benefits and is actually quite easy. In this post, I'll take you through 3 steps to get this working on your credit card-sized computer. Before we get to those steps, I'll explain what a static IP address actually is and why there are several ways of achieving the same result.
What is a static IP address?
A static IP address means that your devices will have the same IP address on your LAN at all times, even after rebooting the computer. This has the benefit that you always know which services live at which IP address and it allows you to build complex systems using all kinds of devices.
What are some ways to set a static IP address?
I mentioned that there are multiple ways to set a static IP address. One of them is to assign an IP address inside of your router for your device. This is usually the best way to do this because it avoids any IP conflicts. The router will be the one to assign the IP addresses and there won't be any duplicates.
There is another way, and that's the way we'll go through in this post: assigning a static IP address inside of the device. This means that the device will ask the router to assign it to the requested IP address. So in simple terms, instead of the router telling the device: "Hey, you're 192.168.1.10" the device asks the router "Can I be 192.168.1.10, please?". This could cause IP conflicts if you have a lot of different devices that all need to be managed through the router. But I've personally only seen this in large office buildings and not in my own home.
Setting a static IP address in your Raspberry Pi
Now that you know what we're going to do, let's actually do it! First, start your Raspberry Pi by plugging it in and open a terminal. You can do this either through the device itself of SSH, but I recommend doing it through the device itself.
Open the configuration:
Now go all the way to the bottom of the file and add these lines:
Let's go through this line by line:
- interface wlan0: We're targeting the Wi-Fi connection, for wired use eth0 instead of wlan0
- static ip_address=192.168.1.10/24: We're setting the static IP to: 192.168.1.10. You can change this to any IP address you prefer.
- static routers=192.168.0.1: Here you fill in the IP address of your router, this can differ for you, so be sure to check this.
- static domain_name_servers=192.168.0.1: Set the name_server to your router as well. This makes sure that your Raspberry Pi will let the router resolve any network connectivity you might have.
When you've added/updated those values, you can save the file and run the last command to make these changes take effect:
This will restart the network service and request your static IP. If you don't have any network connectivity within 10-20 seconds you might have run into an IP conflict and you'll have to repeat the previous steps, selecting a different static IP address.
If you do this through SSH, you will be logged out after you run the last command, because the device will temporarily be disconnected from the network. After 10-20 seconds you can log in using the static IP you've selected.
Setting a static IP address in your Raspberry Pi is a simple 3 step process and has countless of benefits. One of them is that it makes your services easier to find within your network. You'll be able to find any existing services on the same IP address, even after restarting your Raspberry Pi.
If you have any questions or suggestions on how to do this more easily, you can find me on Twitter .
Frequently asked questions

- How To Set A Static IP On A Raspberry Pi
Setting up a static IP for your Raspberry Pi is really easy. The first thing you should know is that these instructions are completely OS dependent. We’re going to assume that you are running Raspbian . We’ve tested this with the February 2020 version which is based on Debian Buster. These instructions should be almost identical for anything based on Debian or Ubuntu. Other Linux distros or non-Linux OSes will be different.
WARNING - If you are doing this remotely ( SSH or VNC ) you might want to be careful. Making a simple mistake or typo could result in not being able to access your devices. If you’re using a keyboard and mouse, don’t worry so much.
NOTE - Any IP or interface name used in this guide will likely need to be changed for your network.
Why would you want a static IP on your Raspberry Pi?
- Running a server
- Want to connect remotely without searching
There are multiple different ways to configure your network on a Debian system. We’re going to show you the “correct” / modern way that people do this on Raspbian.
How To Set A Static IP On A Raspberry Pi - Getting Started
Edit your dhcpcd.conf file ( use nano if you prefer it over vi ):
Add the following lines to the file. Swap in your desired IP information.
Reboot to make sure everything comes up as it should.
You don’t need to reboot. If you want your changes to go into effect but don’t want to reboot you can just flush the interface with the following command.
You don’t need to restart these and it doesn’t seem to update your current IP when you do restart them:
- dhcpcd.service
- networking.service
If you don’t want to edit configuration files and you are using a graphical desktop, you can just use network configuration GUI. You can find this on the taskbar. The GUI basically writes your changes to /etc/dhcpcd.conf similar to if you had done it manually. If you do use the GUI to change your network settings you will still need to either flush the interface or reboot the system as shown above. At least that is what I had to do.
Legacy Configuration
You can still use the legacy configuration file if you want to.
You can edit the interfaces file:
This is how it will look for the eth0 interface:
Using /etc/network/interfaces works but seems to cause dhcpcd.service to fail to start. On reboot you will see that the network configuration GUI has two big red ‘X’s and doesn’t launch.
If you really want to use the interfaces file but you don’t like seeing dhcpcd.service in a failed state you can just stop and disable dhcpcd.service.
This still won’t fix the network configuration GUI but you could just remove that from the bar if you don’t like it.
- Network Config Wiki Document
- Raspberry Pi on Stack Exchange Thread
- Debain Manual - Network Configuration
- TLDP Document
- Electronics
- Fluke 101 Digital Multimeter
- AstroAI AM33D Digital Multimeter
- Hakko FX888D-23BY Digital Soldering Station
- Fluke 101 vs AstroAI AM33D
- How To Connect Raspberry Pi To Laptop Via Wifi
- How To Transfer Files to Raspberry Pi
- How To See Raspberry Pi On Windows Network
- How To Find MAC Address of Raspberry Pi
- How To Find IP Address Of Raspberry Pi
- How To Change Resolution on raspberry pi
- How to Reset or Wipe Raspberry Pi to "Factory Default"
- Freenove Ultimate Starter Kit for Raspberry Pi
- Raspberry Pi Zero
- Raspberry Pi 4
- How Long Can A Raspberry Pi Run On Batteries
- Raspberry Pi Router Firewall
- Tektronix Tekscope - Oscilloscope - THS730A
- Raspberry Pi Alternatives
- Raspberry Pi
- Arduino Uno - Blink LED
- Asus Tinker Board
- Raspberry Pi 4 - LED Blink
- Raspberry Pi Zero W - Setup with NOOBS
- Raspberry Pi - Risk OS
- Raspberry Pi - NoIR Camera V2
- Raspberry Pi - Setup, Find IP Address, and Connect with SSH
- Raspberry Pi - Find IP Address and Connect with SSH from iPad - iPhone - iOS
- Raspberry Pi - Find IP Address and Connect with SSH from Mac OSX
- Raspberry Pi - Find IP Address and Connect with SSH from Android
- Raspberry Pi - Find IP Address and Connect with SSH from Ubuntu Linux
- Raspberry Pi - Find IP Address and Connect with SSH from Windows 10
- Raspberry Pi - How To Check Temperature
- Raspberry Pi - How To Boot from USB
- Raspberry Pi - How To Buy
- Raspberry Pi - How To Backup or Clone SD Card
- Raspberry Pi - How To Disable Bluetooth
- Raspberry Pi - How To Connect and Enable Camera
- Raspberry Pi - How To Check OS Version AND Identify Model
- Raspberry Pi - How To Install Node.js
- Raspberry Pi - How To Check CPU Speed
- Raspberry Pi - How To Enable SSH
- Raspberry Pi - How To Update Firmware
- Raspberry Pi - How To Install Android
- Raspberry Pi - How To Install Python 3
- How to Use an Android Device to Write Raspberry Pi SD Cards
- Raspberry Pi - Lightning Bolt - Under voltage Detected
- ODROID-XU3 Lite
- ODROID-XU4Q
- ODROID-MC1 Solo
- ODROID-HC4 with OLED
- ODROID-GO Advance Black Edition Aura Black
- ODROID-GO Advance Black Edition Clear White
- ODROID-GO Advance
- ODROID-PC Platform Developer Edition
- ODROID-XU+E
- ODROID Original
- ODROID-XU Lite
- Single-Board Computers
- Freenove Robot Dog Kit for Raspberry Pi
- Raspberry Pi - VNC No Matching Security Types
- Default Raspberry Pi Login - Username and Password
- How To Connect PS3 Or PS4 Controller To Raspberry Pi
- BeagleBoard
- Freenove 4WD Smart Car Kit for Raspberry Pi
- Raspberry Pi 7" Touch Screen Display
- Raspberry Pi Camera Long Cable
- Raspberry Pi Firewall and Router with DF Robot Dual NIC
- Raspberry Pi - DNS and DHCP Server
- General Tools AMY6 Magnetic Tester
- ERICKHILL EMF Meter - Electromagnetic Field Radiation Detector
- Adeept RaspTank - Raspberry Pi Robot with Tracks and Robotic Arm
- Create Bootable Raspberry Pi SD Card
- Raspberry Pi Zero 2 W
- Raspberry Pi 400
- Orange Pi Zero 2
- Raspberry Pi OS ( Rasbian ) Networking
- Raspberry Pi Pico - Demo
- Raspberry Pi Pico - Soldering Pins
- Pimoroni Keybow 2040 - Macropad

- Compute Module 4
- Kits & Bundles
- Flash Drives
- Card Readers
- Accessories
- Power Supplies
- Power over Ethernet (PoE)
- Breakout Garden
- GPS, GSM & LoRa
- Motor & Servo Control
- Port Expanders
- Power Management
- Prototyping
- Real Time Clock
- Serial & I2C
- Raspberry Pi 5
- Raspberry Pi 4
- Raspberry Pi 3
- Raspberry Pi 3A+
- Raspberry Pi Zero
- Case Accessories
- DIN & Rack
- Display/Screen
- Media Centre
- Retro Gaming
- Heatsinks & Fans
- Cooling Cases
- Camera Modules
- USB Cameras
- Mini Displays
- Medium Displays
- Large Displays
- Touchscreen Displays
- ePaper Displays
- GPIO Connection
- HDMI Connection
- Display Accessories
- Adapters & Accessories
- Game Controllers
- Keyboards & Mice
- Remote Controls
- WiFi & Ethernet
- Buttons & Joysticks
- HATs & Control Boards
- Merch & Accessories
- Wires & Connectors
- Merch & Clothing
- Notepads & Pens
- Peripherals
- Stickers & Badges
- Amplifiers & Modules
- Cables & Connectors
- Microphones
- Speakers & Headphones
- ADC & DAC
- Flat Cable (FFC/FPC)
- GPIO Expanders
- GPS & GSM
- Logic Level
- DIY Cables & Connectors
- Buttons & Switches
- Component Kits
- Integrated Circuits
- Oscillators
- Transistors
- Circuit Playground
- QT Py & XIAO
- Trinkey & Trinket
- Kits & Projects
- DotStar & APA102
- NeoPixels & WS2812
- Standard LEDs
- Strips & Sticks
- Battery Holders
- Boost Converters
- Power over Ethernet
- Regulators & Buck Converters
- Breadboards
- Crocodile Clips
- Jumper Wires
- PCBs & Perfboard
- SMT Breakouts
- Wire & Heat Shrink
- Motor Drivers
- Mounting Hubs
- Stepper Motors
- Wheels & Tracks
- Accelerometers
- Body & Muscle
- Environment & Air Quality
- Fingerprint
- Force & Weight
- Hall, Reed & Magnet
- IMU & Gyro
- Light & Colour
- Line Following
- Liquid & Moisture
- NFC & RFID
- Temperature
- Tilt & Vibration
- Voltage & Current
- Filament & Resin
- The micro:bit
- Add-ons & Extensions
- Cables & Accessories
- Official Arduino Boards
- Compatible Boards
- GPS & GSM Shields
- Input & Button Shields
- LED Shields
- Prototyping Shields
- Relay Shields
- Robotics Shields
- Sensor Shields
- Serial Shields
- Other Shields
- Raspberry Pi Gifts
- Maker Gifts
- Micro:bit Gifts
- Arduino Gifts
- Gifts Under £10
- Gifts Under £20
- Gifts Under £50
Login / Signup
from just £2.99
137,000+ reviews
support portal
order by 2pm*
Your cart is empty

How to give your Raspberry Pi a Static IP Address - UPDATE
This tutorial will show you how to set a static IP address on your Raspberry Pi with the release of Raspbian Jessie. At the time of writing, the latest release date of Raspbian Jessie is 18-03-2016 with Kernal version 4.1 (but this should work on most versions).
We recommend doing this on a fresh install, however if you have attempted to set a static IP address already, you may have found yourself editing the interfaces file (/etc/network/interfaces). I hope you made a backup, because you’ll need to remove any edits you have made, and revert it back to its original state!
The following is done over SSH, but you could just as well plug your Pi into a monitor, hook up a keyboard and mouse, and use the Terminal instead.
Start by editing the dhcpcd.conf file
sudo nano /etc/dhcpcd.conf

Scroll all the way to the bottom of the file and add one, or both of the following snippets. Depending on whether you want to set a static IP address for a wired connection or a wireless connection eth0 = wired, wlan0 = wireless.
You’ll need to edit the numbers in the snippet so they match your network configuration.
interface = This defines which network interface you are setting the configuration for. static ip_address = This is the IP address that you want to set your device to. (Make sure you leave the /24 at the end) static routers = This is the IP address of your gateway (probably the IP address or your router) static domain_name_servers = This is the IP address of your DNS (probably the IP address of your router). You can add multiple IP addresses here separated with a single space.
To exit the editor, press ctrl+x To save your changes press the letter “Y” then hit enter
Now all you need to do is reboot, and everything should be set!
You can double check by typing
And checking the interfaces IP address

Featured Products

Ulrich Kneidl
in a special use case i need two different addresses over the ethernet/lan port. for example 192.168.100.23 and at the same time 10.168.100.23. is this easy to realize? somewhere i read about a command eth0 add, but i don’t know how to use it.
Leave a comment
All comments are moderated before being published.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

How to Install a Headless Raspberry Pi (No Monitor) In 2023
While Raspberry Pis can be used as a desktop, they are also often used in projects without a monitor or keyboard plugged into it. In these projects, a bit of pre-configuration to skip the welcome wizard can help get access to them directly after the first boot.
The easiest way to pre-configure a Raspberry Pi before the first boot is to use the Advanced Options in Raspberry Pi Imager. By enabling remote access and pre-configuring the user, password and network, the Raspberry Pi will be immediately accessible.
And, you’re in luck, as this procedure is now easier than ever. In this article, I’ll give you all the steps needed to make it work in no time (that’s what I do for all my tutorials).
If you’re looking to quickly progress on Raspberry Pi, you can check out my e-book here . It’s a 30-day challenge where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.
Headless setup prerequisites
On the hardware side, you don’t need anything special to achieve your first headless setup:
- Any Raspberry Pi model : You can obviously pick the best model for your specific project, but all models are compatible with the configuration I’ll show you later. Just make sure to pick one with the right network compatibility (you can’t autoconfigure it for a wireless network if it doesn’t support it).
- An SD card that you’ll overwrite : I recommend getting a different one than your existing system, so you can always get back to it if anything goes wrong. Here is the best SD card according to my benchmarks . You can also use a USB drive ( like an SSD ) if you want, the procedure will be the same.
- Another computer with an SD card reader (or USB adapter ), where you’ll follow the tutorial. It can be a Raspberry Pi if you don’t have another computer available (in this case, you need two SD cards + the USB adapter to plug both at the same time).
For your information, I’m testing this procedure with a Raspberry Pi 400 , and this SD card (a good compromise between performance and price).
On the software side, the only thing we need is Raspberry Pi Imager installed on the main computer (or Raspberry Pi). It’s the free software created by the foundation to install a new system on the Raspberry Pi, and it’s available for all operating systems on their website .
How to set up a headless Raspberry Pi
Luckily, there is no longer any need to edit configuration files on the SD card directly. Raspberry Pi Imager now takes care of everything, so the procedure to pre-configure a Raspberry Pi is pretty straightforward:
- Follow the installation steps in Raspberry Pi Imager as usual.
- Edit the mandatory fields in the OS customization settings (credentials & network).
- Flash the OS to the storage.
Let’s see how to do this step-by-step.
Run Raspberry Pi Imager as usual
If you’ve already used Raspberry Pi Imager, the beginning is the same as usual. Just follow these steps to pick your operating system and storage device:
- (Optional) Select your Raspberry Pi model to filter the list. It will filter the list of operating systems with only the ones compatible with your model. This makes it easier for you to pick the right one.

- Then click on “Next” to move to the next step .
Up to this point, there is no difference between a headless setup and a traditional installation. Things begin to differ in the next step.
Apply the OS customization settings
When you click Next, after selecting the operating system and storage, a popup will appear, asking you if you want to edit the default configuration:

Click on “Edit Settings” to open the default configuration.
A form looking like this will appear:

That’s where the magic happens.
The purpose of a headless setup is to skip the Welcome Wizard and be able to access the Raspberry Pi directly from a remote computer after the first boot. To do this, the username, password and network configuration must be completed through the OS customization settings.
By default, Raspberry Pi OS won’t boot completely, and will show the welcome wizard on the first boot, everything is set here. If you don’t use Ethernet and want to access the Pi directly after the boot, you also need to configure the Wi-Fi network in this form.
Make sure to fill this form with everything you need.
Then, click on “Services” to enable ssh SSH, or Secure Shell Protocol, is a cryptographic network protocol used for securely accessing and... :

SSH is the remote access protocol that will give you access to the Raspberry Pi directly after the first boot. It’s not enabled by default, unless you check this box, and have a username and password set.
If you have done all the other steps but didn’t enable SSH, the Raspberry Pi will skip the Welcome Wizard, but you won’t be able to access the Raspberry Pi from another computer. So, this step is pretty essential.
Once all the configuration is done under “OS Customisation”, click on “Save” and proceed with the SD card writing. Raspberry Pi Imager will apply the settings directly to the SD card or USB drive.
Reminder: Remember that all the members of my community get access to this website without ads, exclusive courses and much more. You can become part of this community for as little as $5 per month & get all the benefits immediately.
- 25 awesome Raspberry Pi project ideas at home
- 15 best operating systems for Raspberry Pi (with pictures)
- My book: Master your Raspberry Pi in 30 days
First boot and Raspberry Pi access
When Raspberry Pi Imager has completed the flashing process, we can move and test our configuration.
Start up the Raspberry Pi
- Insert the SD into the Raspberry Pi (or plug your USB drive).
- Plug in the power supply.
- Wait about 5 minutes for the first boot to complete. It’ll take more or less time depending on your system and Raspberry Pi model, but that should be enough in most cases.
Find its current IP address
If everything goes as expected, the Raspberry Pi should be assigned a new IP address by your network router (whether you use Ethernet or Wi-Fi doesn’t matter).
The issue is that, without a monitor, we can’t read it on the screen as usual, so we need to be a little smarter than that.
The first option is to open the web interface of your router (or DHCP server) and find the assigned IP address there. The second option (what I generally do), is to scan the network for all connected devices, using a command like “nmap” or a tool like Advanced IP Scanner:

In this screenshot, you can see that the tool has found several devices on my network, with one of them matching the hostname I set under “OS Customisation”. That’s my Raspberry Pi, with the IP address 192.168.0.13.
I explain everything in more detail in this article if you need more details: 7 Easy Ways to Find Your Raspberry Pi IP Address
Access it via SSH
Once the Raspberry Pi has fully started up, and you know its IP address, you can access its terminal via SSH.
I won’t explain everything here, as I have a full guide about SSH on Raspberry Pi , but basically, you can use your favorite SSH client, type the IP address found in the previous step, and enter the username and password set during the installation to access it.
Once connected via SSH, you can do everything in command lines , install new packages , and really start your main project.
Going further
If you installed an operating system with a GUI A GUI, or Graphical User Interface, is a visual way for users to interact with... , the next step might be to install one of the remote access solutions available on Raspberry Pi . This will give you access to the full interface, not only the terminal and command lines.
The recommended option currently is to use VNC VNC, or Virtual Network Computing, is a graphical desktop sharing system that allows you to... . It can be enabled easily on Raspberry Pi OS via raspi-config: sudo raspi-config
Once done, you can use a VNC client (like TigerVNC) and connect to the Raspberry Pi to see all the menus and graphical displays, as if the Raspberry Pi was using your computer screen .
I explain everything in this VNC tutorial I recommend reading if you’ve never done this.
And now that you know how to quickly set up a new Raspberry Pi system, with everything configured, it’s time to level up your game and try one of these projects:
- All The Best Raspberry Pi Project Ideas (with links)
- 15 Raspberry Pi Network Projects for Home and Office Use
- 15 Easy Projects for Raspberry Pi Beginners (With Links)
Whenever you’re ready, here are other ways I can help you: The RaspberryTips Community : If you want to hang out with me and other Raspberry Pi fans, you can join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads. Master your Raspberry Pi in 30 days : If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides. The Raspberry Pi Bootcamp : Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects. Master Python on Raspberry Pi : Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts. You can also find all my recommendations for tools and hardware on this page .
Sharing is caring!
I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with web developer experience.
Similar Posts

How to Mine Monero Crypto Currency on your Raspberry Pi
You probably already asked yourself about mining with your Raspberry Pi.Now that Bitcoin is becoming very hard to mine, Monero is the new Bitcoin.In this tutorial you’ll learn how to mine Monero on Raspberry Pi. Mining Monero on Raspberry Pi is easy when you have good tools.You can download and install a miner for free,…

How to Learn to Program in Python with a Raspberry Pi?
Learning Python is an important step to use a Raspberry Pi efficiently. But it’s not straightforward to learn if you start from scratch.I’m a web developer, so I’m good with coding, and I’ll share with you some tips for getting started quickly with Python. The Raspberry Pi system includes an IDE to code in Python,…

Getting Started With Ubuntu MATE on Raspberry Pi
Ubuntu MATE is a Linux distribution for desktop use. It’s based on Ubuntu but uses the MATE desktop environment instead of the latest GNOME versions. MATE is the continuation of GNOME 2, so if, like me, you preferred the old interface, you will love Ubuntu MATE. In this article, I’ll show you how to easily…

How To Install & Use Wireshark On Raspberry Pi
Wireshark is a free and open-source tool to capture and analyze network traffic. Basically, it will intercept network packets and display their content in a nice interface, so you can analyze them. It’s available on Raspberry Pi. I will show you how to install it on your device, and share interesting features for you to…

How to install FreeBSD on Raspberry Pi? (step-by-step guide)
FreeBSD is an original operating system you can install on Raspberry Pi to experiment a bit outside Linux. But the process is not always easy if you are used to working on Debian-like systems.Today, we’ll see how to install it on a Raspberry Pi, to configure it and use it like almost like any other…

Installing Windows 11 on Raspberry Pi (An Illustrated Guide)
Windows 11 was officially released at the end of 2021 for traditional PCs, and you can already get it running on a Raspberry Pi. It’s not as straightforward as installing a Linux distribution that’s made for the Raspberry Pi, but the procedure isn’t that complicated. I will explain everything in this article. The easiest way…
Every Raspberry Pi User’s Secret? This Downloadable Linux Command Cheat Sheet!
Part 1 - Assigining a static IP and allowing password based Auth on Ubuntu 23.10
Oct 23, 2023
Recently, I installed ubuntu 23.10 on my Raspberry Pi 4, and I realized there were a few changes that were done with netplan configurations.
Also I was unable to ssh using password to any of the Pi’s.
So it made me think to blog this and keep it handy for myself and others like me who are in the same boat.
Setting up network after the first boot
When you connect to your Pi after the first boot, and login with the default username / password - ubuntu / ubuntu , you are prompted to change the login password.
- On competing this step, validate the contents of your network. If your network supports DHCP, you will see something like this in sudo cat /etc/netplan/50-cloud-init.yaml
- Before we change any settings in there, you first want to edit sudo vi /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg and add the line into this file. By doing this, we are disabling the cloud-init’s configuration (if you are using it)
- Next, let us configure the Pi to have a static IP. So let us edit the file sudo cat /etc/netplan/50-cloud-init.yaml and add the values for
- addressess - IP address with the subnet range
- via - gateway IP goes in here
- nameservers - DNS server
- search - domains
- dhcp4 - set to false
- optional - set to false
- Finally, run sudo netplan apply , and then try pinging your Pi on the IP address that you configured it with
Enabling password based ssh
If you inspect the sudo cat /etc/ssh/sshd_config.d/50-cloud-init.conf , you will notice that the PasswordAuthentication is disabled. This setting will prevent anyone to ssh onto the Pi using username / password.
The security guidelines dictate that you should use key based authentication to ssh into your Ubuntu OS.
I wanted to allow both, as this is for my non-routable internal lab only.
To do this, simply modify the file sudo vi /etc/ssh/sshd_config.d/50-cloud-init.conf and change the value from no to yes
Finally, restart the ssh service, and now you can ssh to the machine using username / password combo!

IMAGES
COMMENTS
How to Assign a Static IP to a Raspberry Pi 1. Determine your Raspberry PI's current IP v4 address if you don't already know it. The easiest way to do this is by using the hostname...
There are three ways to set a static IP address on Raspberry Pi: assign an IP address to your Raspberry Pi in the router configuration, set a static IP in the desktop environment, or change the dhcpcd.conf configuration file to always use the same IP.
Set up a static IP-address on the Raspberry Pi By default, the Raspberry Pi will get a dynamically allocated IP-address, meaning it changes as you restart it or potentially when new devices are added to the network. To make it easier to connect and have a more stable connection I recommend to set up a static IP address. Table of contents
1. DHCP Configuration Raspberry Pi OS (formerly known as Raspbian) uses DHCP (Dynamic Host Configuration Protocol) to assign an IP address to the Raspberry Pi automatically whenever it is rebooted. You can find out more in our guide to DHCP.
Setting up a static IP address on Raspberry Pi facilitates access and management (e.g., over SSH) by ensuring the device's private IP address does not change. Since most networks use DHCP to dynamically assign IP addresses to clients, setting up a static IP on Raspberry Pi is necessary to avoid access issues.
Take note of the name server IP address and close the file with CTRL + X. 3 - Edit the dhcpcd file on the Raspberry Pi. The static IP is set by adding it to a file on the Raspberry Pi. In the terminal window, run the following command to edit the dhcpcd.conf file. sudo nano /etc/dhcpcd.conf. 4 - Set the static IP address
With the IP address in hand, open a terminal (WSL or PowerShell is fine), and connect with the following command: ssh pi@YourIPaddress Accept the fingerprint by typing yes and hitting enter....
by Emmet Updated Jan 31, 2022 Guides In this Raspberry Pi static IP tutorial, we will show you how to configure your Raspberry Pi's network so that it utilizes a static IP address. We will force the Pi to use a static IP by making modifications to the Raspberry Pi's DHCP client daemon.
When using the Raspberry Pi with a keyboard, mouse, and display, setting up a static IP address for the computer only consists of a few clicks. Start by opening the network settings using the dropdown menu in the top-right corner of the desktop environment: Follow the outlined steps to access the networking settings program.
Power up and log into your Raspberry Pi via WiFi or ethernet, then enter route -ne at the command prompt to see your network routing information: Under the "Gateway" column, you can see your default gateway IP (10.0.0.1 in my case). The "Iface" column lists the names for each connection - ethernet (eth0) and WiFi (wlan0).
Follow the steps below to set a static IP address on your Raspberry Pi via commmand line: Before we get started with setting a static IP address, we should check our current network information to find our default gateway, DNS server, and what type of IP address and subnet our network uses.
7 Answers Sorted by: 340 Raspberry Pi OS Bookworm uses Network Manager by default so this Answer is no longer current. This tutorial describes how to setup networking using the default network manager dhcpcd included in Raspbian since 2015-05-05 and Raspberry Pi OS.
11/29/2022 Configuration How to set a Raspberry Pi with a static ip address? A static IP address, as opposed to a dynamic IP address, doesn't change. The single-board computer Raspberry Pi always needs a static IP address if you want to access it with other devices over a long period of time.
Giving your Raspberry Pi a static IP address on your network means that it will always have the same address for you to connect to. This article assumes you are running Raspberry Pi OS. Step 1 - SSH to Your Raspberry Pi (or Attach a Screen & Keyboard)
To allocate a static IP address to your Raspberry Pi, reserve an address for it on your router. ... If you've already got a Raspberry Pi set up, you can configure SSH using raspi-config. Warning. Depending on the model and SD card, your Raspberry Pi may require up to 5 minutes to boot and connect to your wireless network the first time it boots.
However, this can change whenever you remove the Pi from the network e.g. turn it off. Having a static IP isn't essential, however it will make repeated access to the Raspberry Pi via SSH much simpler, as you'll always know that the Raspberry Pi has the same address. Imagine how much trouble your postman would have if your house constantly changed
Set a Static IP Address on Raspberry Pi (2021) We have discussed two methods to set a static IP address on Raspberry Pi in this article. If you are comfortable with the Terminal, you can go with the first method. But if you want to change it via a graphical interface, follow the router's guide. You can move to any section from the table below.
A static IP address however will not change, it assigns your Raspberry Pi a permanent address on your network - so you know exactly where it is at all times. Setting up a static IP address on your Raspberry Pi can seem like a daunting task, but fear not, we'll walk you through it one step at a time in this tutorial.For this guide,
Setting a static IP on a Raspberry Pi has a lot of benefits and is actually quite easy. In this post, I'll take you through 3 steps to get this working on your credit card-sized computer. Before we get to those steps, I'll explain what a static IP address actually is and why there are several ways of achieving the same result.
Find all the commands and settings you need to set a static IP on a Raspberry Pi. Set it up permanently or temporarily. ... interface eth0 static ip_address=192.168..4/24 static routers=192.168..1 static domain_name_servers=8.8.8.8 8.8.4.4 Reboot to make sure everything comes up as it should.
Start by editing the dhcpcd.conf file. sudo nano /etc/dhcpcd.conf. Scroll all the way to the bottom of the file and add one, or both of the following snippets. Depending on whether you want to set a static IP address for a wired connection or a wireless connection eth0 = wired, wlan0 = wireless. You'll need to edit the numbers in the snippet ...
"In Bullseye it is a longer string of numbers and letters" This is a Predictable Network Interface Name which is normal for most Linux distributions.. If you did a fresh installation Bullseye would use eth0 - you presumably did one of the unsupported "upgrades" which fail to install/update dpkg rules.. You CAN get normal Pi names if you pass net.ifnames=0 on the kernel command line in /boot ...
sudo ip addr. sudo ip rouite. --> As written above, I use the PI headless (no monitor), and so I can not get the information, because communication over network is not working. But when putting the same SD card (which was generated with the PI Imager for Pi 4) in the Pi 3 I can access it successfully.
The best way to do this is setup the static IP at your server (DHCP server), not the client (raspberry pi). Leave pi settings default. Configure your DHCP server (most likely your router) and set the pi to receive a static ip. This for sure. Keep all of the control in one place.
Start up the Raspberry Pi. Insert the SD into the Raspberry Pi (or plug your USB drive). Plug in the power supply. Wait about 5 minutes for the first boot to complete. It'll take more or less time depending on your system and Raspberry Pi model, but that should be enough in most cases.
A static IP address can be useful for remote access systems, like virtual private networks (VPNs) and proxy servers.. Unlike dynamic IP addresses, which most devices use, static IPs don't change. If you're setting up your own server — for example, if you want to host work resources for employees to access remotely — being able to designate a dedicated IP address can be useful.
Part 1 - Assigining a static IP and allowing password based Auth on Ubuntu 23.10. Oct 23, 2023. Recently, I installed ubuntu 23.10 on my Raspberry Pi 4, and I realized there were a few changes that were done with netplan configurations. Also I was unable to ssh using password to any of the Pi's. So it made me think to blog this and keep it ...